[php-src] PR #21923: fix: the rfc1867 multipart form data parser performs... in rfc1867.c
| From: | orbisai0security | Date: | Fri, 01 May 2026 02:04:18 +0000 |
| Subject: | [php-src] PR #21923: fix: the rfc1867 multipart form data parser performs... in rfc1867.c | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-35969@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/21923
Author: orbisai0security
## Summary
Fix critical severity security issue in
main/rfc1867.c.
## Vulnerability
| Field | Value |
|-------|-------|
| **ID** | V-001 |
| **Severity** | CRITICAL |
| **Scanner** | multi_agent_ai |
| **Rule** | V-001 |
| **File** | main/rfc1867.c:72 |
**Description**: The RFC1867 multipart form data parser performs five memmove/memcpy operations
without validating that the source data length fits within the destination buffer. At line 72,
memmove(varname, s, strlen(s)+1) copies the full length of the source string s into varname without
verifying that varname is large enough to hold it. At line 605, memcpy copies len bytes from buf
without confirming len does not exceed the destination buffer size. These code paths are directly
reachable from unauthenticated HTTP POST requests with multipart/form-data content type, making this
a remotely exploitable vulnerability requiring no credentials.
## Changes
- main/rfc1867.c
## Verification
- [x] Build passes
- [x] Scanner re-scan confirms fix
- [x] LLM code review passed
---
*Automated security fix by [OrbisAI Security](https://orbisappsec.com)*