CVE-2021-29421
Python vulnerability analysis and mitigation

Overview

The vulnerability CVE-2021-29421 affects the pikepdf package versions 1.3.0 through 2.9.2 for Python. The vulnerability was discovered in the models/metadata.py component and allows XML External Entity (XXE) attacks when parsing XMP metadata entries. The issue was reported by Eric Therond of Sonarsource and was fixed in pikepdf version 2.10.0, released in April 2021 (GitHub Commit, Fedora Update).

Technical details

The vulnerability exists in the XMP metadata parsing functionality of pikepdf. The issue occurs because the XML parser did not have proper protections against XXE attacks. The fix involved implementing a custom XMLParser class that explicitly disables entity resolution and network access by setting 'resolve_entities=False' and 'no_network=True' parameters (GitHub Commit).

Impact

An attacker who can supply a specially crafted PDF file could potentially exploit this vulnerability to read arbitrary files on the system through XML external entity processing when the PDF's XMP metadata is parsed (Red Hat CVE).

Exploitability

The vulnerability can be exploited by providing a maliciously crafted PDF file containing specially formatted XMP metadata. The attacker would need to be able to have their PDF file processed by an application using an affected version of pikepdf (GitHub Commit).

Mitigation and workarounds

Users should upgrade to pikepdf version 2.10.0 or later which includes the fix for this vulnerability. The fix prevents XXE attacks by implementing proper XML parser configuration that disables entity resolution and network access (Fedora Update).

Additional resources


SourceThis report was generated using AI

Related Python vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2026-52776HIGH8.6
  • Python logoPython
  • compliance-trestle
NoYesAug 12, 2026
CVE-2026-55071HIGH8.4
  • Python logoPython
  • stata-mcp
NoYesAug 12, 2026
CVE-2026-73498HIGH7.7
  • Python logoPython
  • mcp-atlassian
NoYesAug 12, 2026
CVE-2026-55074HIGH7.3
  • Python logoPython
  • ansible-jailexec
NoYesAug 12, 2026
CVE-2026-9318MEDIUM4.8
  • Python logoPython
  • taglib
NoYesAug 12, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management