spiral/session is vulnerable to Path Traversal
98
Critical Risk
The HTTP session component takes the session id directly from the client-supplied sid cookie, and its id validator was inert because it compared the preg_match result with !== false, so the allowlist accepted every string including path separators and .. segments. The default file-based session handler then built the on-disk path by concatenating that value without basename or realpath containment. An unauthenticated request carrying a crafted sid cookie therefore writes the serialized session outside the configured session directory, creating missing parent directories, which can escalate to remote code execution when session content is attacker-influenced and enables session fixation. The fix compares the match result with === 1 to reject invalid ids and wraps the id in basename as defense in depth.
You are affected if you are using a version that falls within the vulnerable range and your application uses the default file-based session handler.
spiral/session is vulnerable to Path Traversal in versions 2.6.0 - 3.13.0 and 3.14.0 - 3.17.0.
Upgrade the spiral/session and/or the spiral/framework library to the patch version.
Connect your repositories to instantly see whether vulnerable or malicious packages exist in your codebase.
Free. No credit card required.

I consent to receiving marketing communications based on Aikido’s Privacy Policy.
SOC 2Compliant
ISO 27001Compliant