Skip to content
This repository was archived by the owner on Jan 26, 2026. It is now read-only.

Commit de28e6e

Browse files
committed
[CVE-2024-40896] Fix XXE protection in downstream code
Some users set an entity's children manually in the getEntity SAX callback to restrict entity expansion. This stopped working after renaming the "checked" member of xmlEntity, making at least one downstream project and its dependants susceptible to XXE attacks. See #761.
1 parent 6ae6536 commit de28e6e

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

parser.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7382,6 +7382,14 @@ xmlParseReference(xmlParserCtxtPtr ctxt) {
73827382
return;
73837383
}
73847384

7385+
/*
7386+
* Some users try to parse entities on their own and used to set
7387+
* the renamed "checked" member. Fix the flags to cover this
7388+
* case.
7389+
*/
7390+
if (((ent->flags & XML_ENT_PARSED) == 0) && (ent->children != NULL))
7391+
ent->flags |= XML_ENT_PARSED;
7392+
73857393
/*
73867394
* The first reference to the entity trigger a parsing phase
73877395
* where the ent->children is filled with the result from

0 commit comments

Comments
 (0)