Skip to content

Honor use_strict_mode for SessionHandler without validateId - #219

Closed
iliaal wants to merge 1 commit into
PHP-8.4from
fix/session-strict-validate-fallback
Closed

Honor use_strict_mode for SessionHandler without validateId#219
iliaal wants to merge 1 commit into
PHP-8.4from
fix/session-strict-validate-fallback

Conversation

@iliaal

@iliaal iliaal commented Aug 5, 2026

Copy link
Copy Markdown
Owner

User save handlers without validateId() historically accepted every session ID, so strict mode could not reject attacker-chosen IDs for the built-in SessionHandler. Exact SessionHandler instances now delegate validation to the wrapped module. Subclasses with custom storage and pure user handlers retain their existing behavior.

@iliaal
iliaal force-pushed the fix/session-strict-validate-fallback branch from ffee250 to efc4db8 Compare August 5, 2026 02:33
SessionHandler does not expose validateId(), so strict mode previously fell
back to php_session_validate_sid() and accepted unknown IDs.

Delegate validation for exact SessionHandler instances to the wrapped module.
Keep historical behavior for subclasses, which may implement custom storage.
@iliaal
iliaal force-pushed the fix/session-strict-validate-fallback branch from efc4db8 to 1051b44 Compare August 5, 2026 12:00
@iliaal

iliaal commented Aug 5, 2026

Copy link
Copy Markdown
Owner Author

Promoted upstream as php#23071, rebased onto master. Strict-mode validation regressed once before in phpGH-9583, so it takes a full release cycle rather than a patch release.

@iliaal iliaal closed this Aug 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant