Skip to content
XXE Disclosed report Intermediate CVE-2021-3902

Improper Restriction of XML External Entity Reference in dompdf/dompdf

The SVG parser in dompdf/dompdf before version 2.0.0 does not properly restrict XML external entities. An attacker could use this to make the server fetch remote resources (SSRF), read internal image files, and trigger PHAR deserialisation, even when the isRemoteEnabled option is disabled.

dompdf/dompdf

Originally disclosed on huntr

Critical View original

An improper restriction of external entities (XXE) vulnerability in dompdf/dompdf's SVG parser allows for Server-Side Request Forgery (SSRF) and deserialization attacks. This issue affects all versions prior to 2.0.0. The vulnerability can be exploited even if the isRemoteEnabled option is set to false. It allows attackers to perform SSRF, disclose internal image files, and cause PHAR deserialization attacks.

From the GitHub Advisory Database (GHSA-3vjh-xrhf-v9xh, CC BY 4.0).

The original report as published on the GitHub Advisory Database. Images and videos are our own copies; raw HTML is shown as text. View it on GitHub Advisory Database.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the SVG parser did not disable external entity resolution, so XML entity declarations were processed even when remote loading was turned off.

Impact

Attackers could perform SSRF, disclose internal image files, and cause PHAR deserialisation attacks; the text does not mention any defence that blocked the exploit.

What the attacker needed

Ability to supply an SVG to dompdf; dompdf version before 2.0.0

The fix

The issue was fixed in version 2.0.0.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

XML documents can include special instructions called external entities that tell the parser to fetch other files or URLs. If a program does not block these, an attacker can make the server read local files or contact internal services. Here, the PDF library's SVG handling allowed this, so a malicious SVG could cause the server to make requests or load files it should not.

What is XXE?

An XML parser resolves entities the attacker defines, reading local files or making the server send requests.

More from dompdf/dompdf

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

XML external entities (XXE)

The lesson behind this report.

An XML parser resolves entities the attacker defines, reading local files or making the server send requests.