/

CVE-2026-24894

Severity:

HIGH RISK

(7.5)

Session Management Vulnerability in FrankenPHP Worker Mode

CVE-2026-24894

Analyzed

Vulnerability type

Category:

Session Management Vulnerability

CWE:

CWE-269, CWE-384, CWE-613

Impact:

Unauthorized Access to Session Data / Session Confidentiality Breach

Severity:

HIGH RISK

(7.5)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

FrankenPHP, when running in worker mode prior to version 1.11.2, fails to correctly reset the PHP $_SESSION superglobal between requests handled by the same worker process.

As a result, a subsequent request can read residual session data from a previous request—potentially belonging to a different user—even before session_start() is called, creating a risk of unauthorized access to another user's session information.

Affected context

The vulnerability occurs in FrankenPHP deployments configured to run in worker mode, where a single long-lived worker process serves multiple HTTP requests sequentially.

In affected versions, the $_SESSION superglobal is not reliably cleared or reinitialized between requests, so data from one request can persist in memory and become visible to a subsequent, unrelated request handled by the same worker.

This typically impacts applications that rely on PHP sessions for user state, authentication, or sensitive data storage.

Exploit preconditions

  • Attack surface: Web applications served by FrankenPHP in worker mode.
  • Required access: Ability to send HTTP requests to the affected application (standard web client access).
  • Trigger point: Any new request processed by a worker that previously handled a different user's request, before session_start() has been invoked.
  • Why exploitation is possible:
  • The worker process reuses the same PHP runtime between requests.
  • $_SESSION is not cleared or reinitialized per request, leaving residual state.
  • Application code may read from $_SESSION (directly or indirectly) before session initialization logic is applied, exposing data from the prior request.

Why this happens

This issue stems from improper session lifecycle management in a long-running worker model.

Instead of treating each HTTP request as an isolated execution context, the runtime allows the $_SESSION superglobal to persist across requests without guaranteed reset.

This maps to CWE-384: Session Fixation / Session Management Vulnerability and is closely related to CWE-269: Improper Privilege Management and CWE-613: Insufficient Session Expiration, because session-bound privileges and data are improperly scoped and isolated.

Conceptually, the bug is an insecure reuse of in-memory session state: request-specific data is stored in a process-global variable that is not reinitialized between uses, breaking the expectation that each user's session is private and tied only to their own authenticated context.

Potential impact

  • A request may read sensitive $_SESSION data belonging to a previous user, including identifiers, CSRF tokens, or application-specific secrets.
  • User-specific configuration or personalization data may be exposed to other users.
  • Application logic that trusts existing $_SESSION content could perform actions based on another user's state, leading to privilege confusion.
  • Leakage of partial authentication or authorization context, which may assist in further attacks such as account takeover or privilege escalation.

General mitigation guidance

Mitigation centers on enforcing strict per-request isolation of session state and avoiding reliance on stale global variables in long-lived workers.

General defensive patterns include:

  • Ensuring that all per-request global state (including $_SESSION) is deterministically reinitialized at the beginning of each request in worker-based servers.
  • Designing frameworks and middleware so that session handling logic runs early in the request pipeline and does not depend on previously set global state.
  • Avoiding storage of security-sensitive material in long-lived global structures unless they are explicitly scoped and cleared per request.
  • Employing defense-in-depth by limiting the amount and sensitivity of data stored in sessions and avoiding overloading session state with excessive authorization or secret data.
  • Applying strict least-privilege principles in application logic so that even if residual session data is visible, it cannot by itself authorize critical operations without fresh, request-bound checks.

How teams detect issues like this

Detection focuses on identifying leaked or reused session state across requests in long-running workers:

  • Static analysis and code review:
  • Look for application or framework code that reads from $_SESSION before explicit session initialization, especially in worker or SAPI implementations.
  • Flag patterns where request-specific state is stored in persistent globals that survive between requests.
  • Review server/runtime integration code that should be responsible for clearing superglobals and other per-request containers.
  • Dynamic and behavioral testing:
  • Create automated tests that send sequential requests through the same worker environment and verify that $_SESSION and other request-specific variables start empty or in a known baseline state.
  • Use fuzzing or integration tests that simulate concurrent or repeated requests under load to observe any cross-request data leakage.
  • Operational monitoring:
  • Instrument applications to log unexpected $_SESSION content or mismatches between session identifiers and authenticated principals.
  • Use runtime security tools or application firewalls that can detect anomalies in session behavior, such as conflicting user identities sharing session-like data.

Automated security scanning tools and CI/CD checks can be configured to inspect framework and server integration code for improper clearing of superglobals and other request globals.

Sources

SourceLink
github.comgithub.com/php/frankenphp/commit/24d6c991a7761b638190eb081deae258143e9735
github.comgithub.com/php/frankenphp/releases/tag/v1.11.2
github.comgithub.com/php/frankenphp/security/advisories/GHSA-r3xh-3r3w-47gp

Frequently asked

questions

It is exploitable wherever FrankenPHP is used in worker mode with sessions, and an attacker can send normal HTTP requests to the application.

The attacker does not need special privileges, but exploitation depends on being scheduled onto a worker that has just processed another user's request and on the application's use of $_SESSION before proper initialization.

Not necessarily.

An unauthenticated attacker can potentially receive residual session data from a prior authenticated user if they happen to be served by the same worker and the application reads from $_SESSION early.

However, the exact impact depends on how the application uses sessions and what data is stored there.

The safest approach is to enforce strict per-request reinitialization of all request-specific globals (including $_SESSION) in worker-based runtimes.

The runtime or integration layer should guarantee that each request starts from a clean, isolated state, independent of any prior request handled by the same process.

When adopting worker or async server models, ensure that:

  • The server/runtime clearly defines a lifecycle hook that resets all per-request state.
  • Session handling and authentication logic are designed to run early and to assume an empty baseline state.
  • Security reviews explicitly consider cross-request leakage in long-lived processes and test for residual variables, caches, and context that could carry data between users.
Find out what's already
exploitable in your codebase.