Skip to content

[CVE-2026-56131] lib: Protect XML_ResumeParser from being called from a handler - #1267

Merged
hartwork merged 1 commit into
libexpat:masterfrom
netliomax25-code:resumeparser-handler-guard
Jun 20, 2026
Merged

hartwork merged 1 commit into
libexpat:masterfrom
netliomax25-code:resumeparser-handler-guard

Conversation

@netliomax25-code

Copy link
Copy Markdown
Contributor
  1. The handler-reentrancy guards from CVE-2026-50219 ([CVE-2026-50219] Introduce handler call depth tracking #1246) added the isCalledFromInsideHandler check to XML_Parse, XML_ParseBuffer, XML_GetBuffer, XML_ParserFree and XML_ParserReset, but XML_ResumeParser was left out.
  2. XML_ResumeParser drives the parser through callProcessor just like XML_Parse, so a handler that first suspends with XML_StopParser(parser, XML_TRUE) (which is allowed from handlers) and then calls XML_ResumeParser(parser) re-enters the parser while the outer parse is still on the stack, the same memory-corruption path the other guards close.
  3. Added the same isCalledFromInsideHandler check at the top of XML_ResumeParser, matching XML_ParseBuffer.

Validation: a regression test suspends from a character data handler and asserts the in-handler resume is rejected. It fails before the change (the resume returns a non-error status and re-enters the parser) and passes after. Full suite green afterwards (Checks: 4812, Failed: 0).

The handler-reentrancy guards from CVE-2026-50219 cover XML_Parse, XML_ParseBuffer, XML_GetBuffer, XML_ParserFree and XML_ParserReset but not XML_ResumeParser, which drives the parser through callProcessor in the same way.
@simoneves

Copy link
Copy Markdown

Is there an ETA for this fix, and presumably a consequential 2.8.2 release, please?

@hartwork

Copy link
Copy Markdown
Member

Is there an ETA for this fix, and presumably a consequential 2.8.2 release, please?

@simoneves no ETA for this or 2.8.2, I'm overloaded, please be patient.

@simoneves

Copy link
Copy Markdown

Understood. Just saw your front-page message. Sorry.

@hartwork hartwork left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@netliomax25-code I confirm, very nice finding and pull request! I'll request a CVE for vulnerability "incomplete fix to CVE-2026-50219" in a minute and merge once we got a CVE.

@hartwork hartwork added this to the 2.8.2 milestone Jun 14, 2026
@hartwork hartwork changed the title lib: protect XML_ResumeParser from being called from a handler [CVE-TODO] lib: Protect XML_ResumeParser from being called from a handler Jun 14, 2026
@hartwork hartwork changed the title [CVE-TODO] lib: Protect XML_ResumeParser from being called from a handler [CVE-TODO] lib: Protect XML_ResumeParser from being called from a handler Jun 14, 2026
@hartwork hartwork changed the title [CVE-TODO] lib: Protect XML_ResumeParser from being called from a handler [CVE-REQUESTED] lib: Protect XML_ResumeParser from being called from a handler Jun 14, 2026
@hartwork

Copy link
Copy Markdown
Member

Update: CVE requested from Mitre just now.

@hartwork hartwork mentioned this pull request Jun 15, 2026
29 tasks done
@netliomax25-code

Copy link
Copy Markdown
Contributor Author

Sounds good, thanks for handling the CVE side. The branch still applies cleanly on master, so nothing pending from my end. Happy to adjust anything before merge if you want it shaped differently.

@Phlegmelm

Copy link
Copy Markdown

Is there an ETA for this fix, and presumably a consequential 2.8.2 release, please?

@simoneves no ETA for this or 2.8.2, I'm overloaded, please be patient.

I can assist, and help out if needed, would love to.

@hartwork

Copy link
Copy Markdown
Member

@Phlegmelm thanks for your offer to help! Analysis, code review and requesting a CVE from Mitre are all done by now. So only receiving the CVE, putting it in the pull request subject, and merging the pull request are left to do at this point, it's basically already done.

@hartwork hartwork changed the title [CVE-REQUESTED] lib: Protect XML_ResumeParser from being called from a handler [CVE-2026-56131] lib: Protect XML_ResumeParser from being called from a handler Jun 20, 2026
@hartwork

Copy link
Copy Markdown
Member

CVE-2026-56131 has been assigned by now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants