Projects
home:rottame:vhosts-ng:php74
php7
php7-CVE-2026-129289.patch
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File php7-CVE-2026-129289.patch of Package php7
From 28014fd092c7acdafb9c074e735f099893a5ef66 Mon Sep 17 00:00:00 2001 From: Jakub Zelenka <bukka@php.net> Date: Thu, 29 Oct 2026 11:19:04 +0100 Subject: [PATCH] Fix GHSA-qc49-hpvq-g2w6: Drain unread request bodies Opening php://input can create a request body stream without consuming the input from the SAPI. Request shutdown treated the stream as proof that the body was read and skipped the drain. Drain whenever post_read is false, independently of whether the stream exists. This keeps unread FastCGI STDIN bytes from being parsed as another request when FCGI_KEEP_CONN is set. As a final safeguard, reject a new FastCGI request if the previous STDIN record was only partially consumed. --- main/SAPI.c | 3 +- main/fastcgi.c | 6 + sapi/fpm/tests/unread-body-keep-conn.phpt | 125 +++++++++++++++++ .../fpm/tests/unread-body-partial-record.phpt | 127 ++++++++++++++++++ 4 files changed, 260 insertions(+), 1 deletion(-) create mode 100644 sapi/fpm/tests/unread-body-keep-conn.phpt create mode 100644 sapi/fpm/tests/unread-body-partial-record.phpt Index: php-7.4.33/main/SAPI.c =================================================================== --- php-7.4.33.orig/main/SAPI.c +++ php-7.4.33/main/SAPI.c @@ -496,7 +496,8 @@ SAPI_API void sapi_deactivate(void) zend_llist_destroy(&SG(sapi_headers).headers); if (SG(request_info).request_body) { SG(request_info).request_body = NULL; - } else if (SG(server_context)) { + } + if (SG(server_context)) { if (!SG(post_read)) { /* make sure we've consumed all request input data */ char dummy[SAPI_POST_BLOCK_SIZE]; Index: php-7.4.33/main/fastcgi.c =================================================================== --- php-7.4.33.orig/main/fastcgi.c +++ php-7.4.33/main/fastcgi.c @@ -1049,6 +1049,10 @@ static int fcgi_read_request(fcgi_reques int len, padding; unsigned char buf[FCGI_MAX_LENGTH+8]; + if (UNEXPECTED(req->in_len != 0)) { + return 0; + } + req->keep = 0; req->ended = 0; req->in_len = 0; @@ -1312,6 +1316,8 @@ void fcgi_close(fcgi_request *req, int f req->nodelay = 0; #endif req->fd = -1; + /* a partially read STDIN record does not outlive its connection */ + req->in_len = 0; req->hook.on_close(); }
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.