php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #66119 FPM full status produces invalid JSON with double quotes in query string
Submitted: 2013-11-19 16:51 UTC Modified: 2021-08-23 18:15 UTC
Votes:7
Avg. Score:4.1 ± 0.3
Reproduced:7 of 7 (100.0%)
Same Version:1 (14.3%)
Same OS:1 (14.3%)
From: andy at propcom dot co dot uk Assigned: cmb (profile)
Status: Duplicate Package: FPM related
PHP Version: 5.4.22 OS: CentOS
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
43 - 40 = ?
Subscribe to this entry?

 
 [2013-11-19 16:51 UTC] andy at propcom dot co dot uk
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"...

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2021-05-29 11:22 UTC] michiel at hazelhof dot nl
Seems to be a duplicate of #64539
 [2021-08-23 18:15 UTC] cmb@php.net
-Status: Open +Status: Duplicate -Assigned To: +Assigned To: cmb
 [2021-08-23 18:15 UTC] cmb@php.net
Closing as duplicate of bug #64539.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 14:01:28 2024 UTC