Session Fixation
CVE-2026-33492
HIGH
Severity by source
AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:N
Primary rating from GitHub Advisory · only source for this CVE.
CVSS VectorGitHub Advisory
CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:N
Lifecycle Timeline
2DescriptionGitHub Advisory
Summary
AVideo's _session_start() function accepts arbitrary session IDs via the PHPSESSID GET parameter and sets them as the active PHP session. A session regeneration bypass exists for specific blacklisted endpoints when the request originates from the same domain. Combined with the explicitly disabled session regeneration in User::login(), this allows a classic session fixation attack where an attacker can fix a victim's session ID before authentication and then hijack the authenticated session.
Details
The vulnerability is a chain of three weaknesses that together enable session fixation:
1. Attacker-controlled session ID acceptance (objects/functionsPHP.php:344-367)
function _session_start(array $options = [])
{
// ...
if (isset($_GET['PHPSESSID']) && !_empty($_GET['PHPSESSID'])) {
$PHPSESSID = $_GET['PHPSESSID'];
// ...
if (!User::isLogged()) {
if ($PHPSESSID !== session_id()) {
_session_write_close();
session_id($PHPSESSID); // <-- sets session to attacker's ID
}
$session = @session_start($options); // <-- starts with attacker's IDThe code reads $_GET['PHPSESSID'] and programmatically calls session_id($PHPSESSID), which bypasses both session.use_only_cookies and session.use_strict_mode PHP settings since the session ID is set via the PHP API, not via cookie/URL handling.
2. Session regeneration bypass for blacklisted endpoints (objects/functionsPHP.php:375-378, objects/functions.php:3100-3116)
// functionsPHP.php:375-378
if (!blackListRegenerateSession()) {
_session_regenerate_id(); // <-- SKIPPED when blacklisted + same-domain
}// functions.php:3100-3116
function blackListRegenerateSession()
{
if (!requestComesFromSafePlace()) {
return false;
}
$list = [
'objects/getCaptcha.php',
'objects/userCreate.json.php',
'objects/videoAddViewCount.json.php',
];
foreach ($list as $needle) {
if (str_ends_with($_SERVER['SCRIPT_NAME'], $needle)) {
return true; // <-- regeneration skipped for these endpoints
}
}
return false;
}The requestComesFromSafePlace() check at objects/functionsSecurity.php:182 only verifies that HTTP_REFERER matches the AVideo domain. When a victim clicks a link from within the AVideo platform (e.g., in a comment or video description), the browser naturally sets the Referer to the AVideo domain, satisfying this check.
3. Disabled session regeneration on login (objects/user.php:1315-1317)
// Call custom session regenerate logic
// this was regenerating the session all the time, making harder to save info in the session
//_session_regenerate_id(); // <-- COMMENTED OUTThe session regeneration after authentication is explicitly disabled. This means the session ID persists unchanged through the login transition, which is the fundamental requirement for session fixation to succeed.
Amplifying factors
objects/phpsessionid.json.phpexposes session IDs to any same-origin JavaScript without authentication (line 12:$obj->phpsessid = session_id())view/js/session.jsstores the session ID in a globalwindow.PHPSESSIDvariable and logs it to console (line 15)- No session-to-IP or session-to-user-agent binding exists (verified via codebase search)
PoC
Step 1: Attacker obtains a session ID
# Attacker visits the site to get a valid session ID
curl -v https://target.example.com/ 2>&1 | grep 'set-cookie.*PHPSESSID'
# Response: Set-Cookie: PHPSESSID=attacker_known_session_id; ...Step 2: Attacker injects a link on the platform
The attacker posts a comment on a video or creates content containing a link:
https://target.example.com/objects/getCaptcha.php?PHPSESSID=attacker_known_session_idThis can be placed in a video comment, video description, user bio, or forum post - anywhere AVideo renders user-provided links.
Step 3: Victim clicks the link while browsing AVideo
When the victim clicks the link from within the AVideo platform:
- Browser sets
Referer: https://target.example.com/...(same-domain) _session_start()processes$_GET['PHPSESSID'], victim is not logged in, sosession_id('attacker_known_session_id')is calledblackListRegenerateSession()returnstrue(script isgetCaptcha.php+ same-domain Referer)_session_regenerate_id()is skipped- Victim's session is now fixed to
attacker_known_session_id
Step 4: Victim logs in
The victim navigates to the login page and authenticates. User::login() populates $_SESSION['user'] but does NOT regenerate the session ID (line 1317 is commented out).
Step 5: Attacker hijacks the authenticated session
# Attacker uses the known session ID to access victim's account
curl -b "PHPSESSID=attacker_known_session_id" https://target.example.com/objects/user.php?userAPI=1
# Response: victim's user data, confirming session hijackImpact
- Full account takeover: An attacker can hijack any user's authenticated session, including administrator accounts
- Data access: Full access to the victim's videos, private content, messages, and personal information
- Privilege escalation: If the victim is an admin, the attacker gains full administrative control over the AVideo instance
- Lateral actions: The attacker can perform any action as the victim - upload/delete content, modify settings, access admin panel
Recommended Fix
Fix 1: Re-enable session regeneration on login (objects/user.php:1317)
// Replace the commented-out line:
//_session_regenerate_id();
// With:
_session_regenerate_id();This is the most critical fix. Session regeneration on authentication transition is a fundamental defense against session fixation (OWASP recommendation).
Fix 2: Remove GET-based session ID acceptance (objects/functionsPHP.php:344-383)
Remove or restrict the $_GET['PHPSESSID'] handling entirely. If it is needed for specific use cases (e.g., CAPTCHA), validate the session ID against a server-side token rather than blindly accepting arbitrary values:
// Instead of accepting any GET PHPSESSID, remove this block entirely.
// If CAPTCHA requires session continuity, pass a CSRF token instead.
if (isset($_GET['PHPSESSID']) && !_empty($_GET['PHPSESSID'])) {
// REMOVED: Do not accept session IDs from URL parameters
}Fix 3: Remove session ID exposure (objects/phpsessionid.json.php, view/js/session.js)
The phpsessionid.json.php endpoint and the session.js global variable negate the httponly cookie flag. If JavaScript needs to reference the session for AJAX requests, the browser automatically includes session cookies - there is no need to expose the session ID value to JavaScript.
AnalysisAI
AVideo, an open-source video platform, contains a session fixation vulnerability that allows attackers to hijack user sessions and achieve full account takeover. The flaw affects the AVideo Composer package (pkg:composer/wwbn_avideo) and stems from accepting arbitrary session IDs via URL parameters, bypassing session regeneration for specific endpoints, and disabled session regeneration during login. A public proof-of-concept exploit is available in the GitHub security advisory, and the vulnerability requires only low privileges (authenticated attacker) and user interaction (victim clicking a malicious link), making it highly exploitable.
Technical ContextAI
This vulnerability affects AVideo, a PHP-based video streaming platform distributed via Composer (pkg:composer/wwbn_avideo). The root cause is CWE-384 (Session Fixation), a classic web security flaw where attackers can force victims to use a predetermined session identifier. The vulnerability chains three implementation weaknesses: the _session_start() function accepts attacker-controlled session IDs from the PHPSESSID GET parameter and programmatically sets them via PHP's session_id() API (bypassing session.use_strict_mode protections), specific endpoints like getCaptcha.php skip session regeneration when requests originate from the same domain, and the User::login() function has session regeneration explicitly disabled via commented-out code. Additionally, the platform exposes session IDs through a JSON endpoint (phpsessionid.json.php) and JavaScript global variables, negating HttpOnly cookie protections.
RemediationAI
Apply patches provided by the AVideo project via the GitHub security advisory at https://github.com/WWBN/AVideo/security/advisories/GHSA-x3pr-vrhq-vq43. The primary fix requires three code changes: re-enable session regeneration in objects/user.php line 1317 by uncommenting the _session_regenerate_id() call in the User::login() function, remove or strictly validate the GET-based PHPSESSID parameter handling in objects/functionsPHP.php lines 344-383 to prevent attacker-controlled session IDs, and remove session ID exposure via objects/phpsessionid.json.php and view/js/session.js which negate HttpOnly protections. Until patching is complete, implement compensating controls such as enforcing IP-based session validation, implementing additional CSRF tokens for sensitive operations, and monitoring for suspicious session fixation attempts by logging instances where PHPSESSID is passed via GET parameters.
More in Session Fixation
View allSession fixation vulnerability in Apache2Triad 1.5.4 allows remote attackers to hijack web sessions via the PHPSESSID pa
Improper session management in the /login_ok.htm endpoint of DAEnetIP4 METO v1.25 allows attackers to execute a session
Tiny File Manager v2.4.7 and below is vulnerable to session fixation. Rated critical severity (CVSS 9.8), this vulnerabi
A critical vulnerability was found in PHPGurukul User Registration & Login and User Management System V3.3 in the /login
Franklin Fueling Systems System Sentinel AnyWare (SSA) version 1.6.24.492 is vulnerable to Session Fixation. Rated criti
An issue in China Mobile Communications China Mobile Intelligent Home Gateway v.HG6543C4 allows a remote attacker to exe
A privilege escalation issue was found in PHP Gurukul Hospital Management System In v.4.0 allows a remote attacker to ex
Session Fixation in GitHub repository ikus060/rdiffweb prior to 2.4.7. Rated critical severity (CVSS 9.8), this vulnerab
Certain NetModule devices allow Limited Session Fixation via PHPSESSID. Rated critical severity (CVSS 9.8), this vulnera
An issue was discovered in DAViCal Andrew's Web Libraries (AWL) through 0.60. Rated critical severity (CVSS 9.8), this v
clonos.php in ClonOS WEB control panel 19.09 allows remote attackers to gain full access via change password requests be
Gogs 0.11.66 allows remote code execution because it does not properly validate session IDs, as demonstrated by a ".." s
Same weakness CWE-384 – Session Fixation
View allShare
External POC / Exploit Code
Leaving vuln.today
GHSA-x3pr-vrhq-vq43