Bug #66119 [NEW]: FPM full status produces invalid JSON with double quotes in query string

From: Date: Tue, 19 Nov 2013 16:51:36 +0000
Subject: Bug #66119 [NEW]: FPM full status produces invalid JSON with double quotes in query string
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-182833@lists.php.net to get a copy of this message
From: andy at propcom dot co dot uk Operating system: CentOS PHP version: 5.4.22 Package: FPM related Bug Type: Bug Bug description:FPM full status produces invalid JSON with double quotes in query string Description: ------------ The query string of an FPM request is copied unescaped into the JSON output. If the query string contains an unescaped double quote, this causes invalid JSON to be output. The query string is correctly escaped when output as HTML or XML, this needs extending to JSON: https://github.com/php/php-src/blob/PHP-5.4.22/sapi/fpm/fpm/fpm_status.c#L421 Test script: --------------- Note that most browsers will urlencode double quotes automatically so CURL (or equivalent) should be used to test. curl 'http://localhost/sleep.php?test"foo' & curl 'http://localhost/fpmstatus.php?json&full' Expected result: ---------------- ..."request uri":"/sleep.php?test\"foo"... Actual result: -------------- ..."request uri":"/sleep.php?test"foo"... -- Edit bug report at https://bugs.php.net/bug.php?id=66119&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=66119&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=66119&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=66119&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=66119&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=66119&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=66119&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=66119&r=needscript Try newer version: https://bugs.php.net/fix.php?id=66119&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=66119&r=support Expected behavior: https://bugs.php.net/fix.php?id=66119&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=66119&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=66119&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=66119&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=66119&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=66119&r=dst IIS Stability: https://bugs.php.net/fix.php?id=66119&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=66119&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=66119&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=66119&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=66119&r=mysqlcfg

« previous php.bugs (#182833) next »