fix: four memcpy calls in main/streams/filter in filter.c#21782
fix: four memcpy calls in main/streams/filter in filter.c#21782orbisai0security wants to merge 1 commit intophp:masterfrom
Conversation
Automated security fix generated by Orbis Security AI
|
Thanks for being upfront at least but which agent(s) did you use ? I barely see a necessary change here. Would you have a reproducer ? |
|
Hey, totally fair questions. This was generated by OrbisAI (automated security scanner). We use a bunch of LLMs underneath to find security vulnerabilities. I don't have a manual reproducer for this issue. |
| /* all data in a persistent bucket must also be persistent */ | ||
| bucket->buf = pemalloc(buflen, true); | ||
| memcpy(bucket->buf, buf, buflen); | ||
| if (EXPECTED(buflen > 0 && buf != NULL)) { |
There was a problem hiding this comment.
the buffer had been allocated with the needed sized and with ZendMM, so the overflow cannot happen in that regard, the CWE label is a bit dramatic here especially in the lack of reproducer :) but thank for your efforts regardless.
Unless a reproducer can be provided to actually trigger it, I am going to close this PR. Saying this, we will gladly welcome your future contributions, cheers ! |
Summary
Fix critical severity security issue in
main/streams/filter.c.Vulnerability
V-001main/streams/filter.c:78Description: Four memcpy calls in main/streams/filter.c copy data into heap-allocated bucket buffers without verifying that the source length does not exceed the allocated destination buffer size. An attacker who can supply crafted stream input with a reported length exceeding the actual allocation triggers a heap buffer overflow, overwriting adjacent heap metadata. This is reachable via any PHP application that processes stream filters, including the built-in php://filter wrapper.
Changes
main/streams/filter.cVerification
Automated security fix by OrbisAI Security