Skip to content

Prevent circumvention via specially crafted serialized string#17

Open
huncrys wants to merge 1 commit into
dbrumann:2.xfrom
huncrys:patch-1
Open

Prevent circumvention via specially crafted serialized string#17
huncrys wants to merge 1 commit into
dbrumann:2.xfrom
huncrys:patch-1

Conversation

@huncrys

@huncrys huncrys commented Mar 12, 2025

Copy link
Copy Markdown

According to upstream sources a sign (+, -) is accepted before the length: https://github.com/php/php-src/blob/PHP-5.4.45/ext/standard/var_unserializer.re#L260-L266

So it is possible to circumvent the polyfill by manually adding it, i.e.:

O:9:"Exception" vs O:+9:"Exception"

According to upstream sources a sign (`+`, `-`) is accepted before the length:
https://github.com/php/php-src/blob/PHP-5.4.45/ext/standard/var_unserializer.re#L260-L266

So it is possible to circumvent the polyfill by manually adding it, i.e.:

`O:9:"Exception"` vs `O:+9:"Exception"`
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