php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #81000 syntax error in php://input
Submitted: 2021-04-29 08:34 UTC Modified: 2021-04-29 08:39 UTC
From: ahirsch29 at gmail dot com Assigned:
Status: Duplicate Package: FPM related
PHP Version: 8.0.3 OS: Alpine Linux v3.13.5
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: ahirsch29 at gmail dot com
New email:
PHP Version: OS:

 

 [2021-04-29 08:34 UTC] ahirsch29 at gmail dot com
Description:
------------
FastCGI sent in stderr: "Parse error: syntax error, unexpected identifier "version" in php://input on line 1" when sending POST with the following POST-Data:
<?xml version="1.0" encoding="UTF-8"?>
<cXML>
</cXML>

If I am sending the following data to the script:
<?php echo 3 + 3; ?>
<test>test</test>

I am getting this result:
6
<test>test</test>

Somehow the XML get's interpreted without any logic within the script that is called.

Rebooting the docker container (8.0.3-fpm-alpine3.13) will solve the problem for a while - but after a couple hours the problem appears again.

Currently OpCache is enabled - also tryed to disable it.

Log does not show anything special:
10.240.0.100 - 29/Apr/2021:08:26:58 +0000 "POST /index.php" 200

Even if i place invalid code into the index.php:
<?php
thisShouldNotWork();

I am getting this result:
6
<test>test</test><br />
<b>Fatal error</b>:  Uncaught Error: Call to undefined function thisShouldNotWork() in /app/source/index.php:2
Stack trace:
#0 {main}
  thrown in <b>/app/source/index.php</b> on line <b>2</b><br />

But the log shows a successful POST - even a excaption was thrown:
10.240.0.100 - 29/Apr/2021:08:29:28 +0000 "POST /index.php" 200


There might be a related bug for 7.x: https://bugs.php.net/bug.php?id=80378

Test script:
---------------
The script (index.php) contains nothing but a die();:
<?php
die();

There is no logic at all within this script so I am asuming this error somewhere else.


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2021-04-29 08:35 UTC] ahirsch29 at gmail dot com
-Package: *General Issues +Package: FPM related
 [2021-04-29 08:35 UTC] ahirsch29 at gmail dot com
changed Package
 [2021-04-29 08:39 UTC] requinix@php.net
-Status: Open +Status: Duplicate
 [2021-04-29 08:39 UTC] requinix@php.net
Sounds like bug #80385.
 [2021-04-29 09:57 UTC] ahirsch29 at gmail dot com
For giving more insights into the infra structure:
The application is hosted within AKS and there are two containers:
1) httpd:2.4.46-alpine
directs to php-fpm via Proxy:
<VirtualHost *:80>
  ProxyPassMatch ^/(.*\.php(/.*)?)$ fcgi://ottofischer-<environment>-php-fpm:9000/app/source/$1
  DirectoryIndex /index.php index.php
  DocumentRoot "/app/source"
  RequestHeader set X-Forwarded-server https
  <Directory "/app/source">
    Options Indexes FollowSymLinks
    AllowOverride All
    Require all granted
    DirectoryIndex index.php
  </Directory>
</VirtualHost>


2) php8.0.3-alpine3.13
All configs are standard / using php.ini-production as php.ini.

listen = 127.0.0.1:9000

Port 9000 is published internally, but not externally:
apiVersion: v1
kind: Service
metadata:
  name: {{ .Chart.Name }}-php-fpm
spec:
  selector:
    app: {{ .Chart.Name }}-php-fpm
  ports:
      - name: php-fpm
        protocol: TCP
        port: 9000
        targetPort: 9000
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 16:01:28 2024 UTC