facebook / facebook/hhvm

unserialize() does not support 'S:' encoded binary string values

Open
#7,258 0 comments 0 reactions 0 assignees View on GitHub
low-pri php5 incompatibility probably easy
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.