Miggo Logo

CVE-2024-50602:
An issue was discovered in libexpat before 2.6.4. There is a crash within the XML_ResumeParser...

5.9

CVSS Score
3.1

Basic Information

EPSS Score
0.12417%
Published
10/27/2024
Updated
4/30/2025
KEV Status
No
Technology
-

Technical Details

CVSS Vector
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability occurs because XML_StopParser could be called on an XML parser that had been created (XML_ParserCreate) but not yet started (e.g., no input fed via XML_Parse or XML_ParseBuffer). This action would put the parser into an inconsistent state. Subsequently, if XML_ResumeParser was called on this parser, it would crash due to attempting to access uninitialized or improperly set internal structures, specifically leading to a NULL pointer dereference in normal_updatePosition as shown in the test case commit message (b3836ff534c7cc78128fe7b935aad3d4353814ed).

The primary vulnerable function is XML_ResumeParser because it's the one that crashes. However, XML_StopParser is also culpable because its incorrect behavior (allowing an unstarted parser to be stopped/suspended) sets up the conditions for the crash. The patches address the issue by modifying XML_StopParser to explicitly disallow stopping/suspending an unstarted parser (commit 51c7019069b862e88d94ed228659e70bddd5de09) and by adding test cases to verify this fix and the crash scenario (commit b3836ff534c7cc78128fe7b935aad3d4353814ed).

The runtime indicators would be XML_ResumeParser appearing in a stack trace, likely preceded by calls that set up the vulnerable state, such as XML_ParserCreate, XML_GetBuffer (or similar to get the parser into a state where XML_StopParser might be called), and then XML_StopParser itself. The crash itself, as detailed in the commit message for the test case, happens within normal_updatePosition, called by initUpdatePosition, which is called by XML_ResumeParser.

Therefore, the key functions involved in triggering the vulnerability are XML_StopParser (due to its flawed logic) and XML_ResumeParser (where the crash manifests).

Vulnerable functions

Only Mi**o us*rs **n s** t*is s**tion

WAF Protection Rules

WAF Rule

*n issu* w*s *is*ov*r** in li**xp*t ***or* *.*.*. T**r* is * *r*s* wit*in t** XML_R*sum*P*rs*r *un*tion ****us* XML_StopP*rs*r **n stop/susp*n* *n unst*rt** p*rs*r.

Reasoning

T** vuln*r**ility o**urs ****us* `XML_StopP*rs*r` *oul* ** **ll** on *n XML p*rs*r t**t *** ***n *r**t** (`XML_P*rs*r*r**t*`) *ut not y*t st*rt** (*.*., no input *** vi* `XML_P*rs*` or `XML_P*rs**u***r`). T*is **tion woul* put t** p*rs*r into *n in*o