unserialize() does not support 'S:' encoded binary string values
- Dominant language
- C++
- Stars
- 18.7k
- Forks
- 3.1k
- Avg merge
- 1h 47m
- Merged PRs (30d)
- 2
Description
Not sure whether this is worth implementing, though it could perhaps be useful for some applications:
It was [recently noted](https://www.evonide.com/fuzzing-unserialize/#Unserialize_Syntax) that PHP's unserialize() function has support for an 'S:' string type, which unlike 's:', supports escape sequences. Support was added in PHP 5.2.1 (php/php-src@8f5310afad0eeef6f2e45a03f6ff7d4a2a7653ce) for forward compatibility with PHP 6, which was never released.
For reference, the current PHP implementation can be found here:
https://github.com/php/php-src/blob/e70f9fa01aa1dbf60201ef31e474bf39ad677dcd/ext/standard/var_unserializer.re#L668-L700
https://github.com/php/php-src/blob/e70f9fa01aa1dbf60201ef31e474bf39ad677dcd/ext/standard/var_unserializer.re#L169-L210
### HHVM Version
HipHop VM 3.15.0-dev (rel)
Compiler: heads/master-0-g17e1c0b1425733e5f34287b674f2456978c9008b
Repo schema: 7457716dbd7150059b4a315d3f986266d72e8ad8
### Standalone code, or other way to reproduce the problem
```
Contributor guide
Assessment
This issue has not been assessed yet.