---
id: CVE-2021-29421
aliases:
  - GHSA-ccgm-3xw4-h5p8
  - PYSEC-2021-34
title: Improper Restriction of XML External Entity Reference in pikepdf
summary: Improper Restriction of XML External Entity Reference in pikepdf
severity: high
cvss: 7.5
cvssVector: 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N'
vendor: pikepdf
product: pikepdf
ecosystem: pip
affected:
  - 'pikepdf >= 1.3.0, < 2.10.0'
patched:
  - pikepdf 2.10.0
published: '2021-04-20'
updated: '2026-09-10'
sourceUpdated: '2026-09-10T03:49:03.241318694Z'
source: OSV
sourceUrl: 'https://osv.dev/vulnerability/GHSA-ccgm-3xw4-h5p8'
references:
  - url: 'https://nvd.nist.gov/vuln/detail/CVE-2021-29421'
  - url: >-
      https://github.com/pikepdf/pikepdf/commit/3f38f73218e5e782fe411ccbb3b44a793c0b343a
  - url: 'https://github.com/advisories/GHSA-ccgm-3xw4-h5p8'
  - url: 'https://github.com/pikepdf/pikepdf'
  - url: >-
      https://github.com/pypa/advisory-database/tree/main/vulns/pikepdf/PYSEC-2021-34.yaml
  - url: >-
      https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/36P4HTLBJPO524WMQWW57N3QRF4RFSJG
  - url: >-
      https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/3QFLBBYGEDNXJ7FS6PIWTVI4T4BUPGEQ
tags:
  - osv
  - pip
epss: 0.01681
epssPercentile: 0.75956
ingestedAt: '2026-09-12T03:13:01.687Z'
---

## Overview

models/metadata.py in the pikepdf package 1.3.0 through 2.9.2 for Python allows XXE when parsing XMP metadata entries.

## Affected packages

- `pikepdf >= 1.3.0, < 2.10.0`

## Remediation

Upgrade to a patched release:

- `pikepdf 2.10.0`
