Summary
An information disclosure vulnerability in pypdf can expose placeholder contents in encrypted templated PDFs. If an attacker has a document based on the same template and can access file identifiers for other documents, they may be able to infer protected content.
Affected context
The issue affects workflows that create encrypted PDFs from shared templates when file identifiers can be observed across documents. Risk depends on the identifiers' relationship to document content and whether an attacker can obtain identifiers for documents using the same template.
Exploit preconditions
- Attack surface: Processing or sharing encrypted, templated PDF documents
- Required access: A document using the same template and access to other documents' file identifiers
- Trigger point: Analysis of file identifiers associated with the documents
- Why exploitation is possible: Identifier patterns may allow an attacker to guess placeholder contents despite PDF encryption
Why this happens
The underlying issue is insufficient protection of sensitive information through document identifiers or related metadata. If identifiers expose patterns or enable guesses about placeholder values, encryption of the PDF contents alone may not prevent disclosure. This maps to CWE-200: Exposure of Sensitive Information to an Unauthorized Actor.
Potential impact
- An attacker may infer placeholder values in encrypted documents
- Confidential information represented by placeholders could be disclosed
- Repeated use of a template could make cross-document analysis easier
- Exposure could affect the privacy of people or organizations named in documents
General mitigation guidance
Defensive patterns include reducing the information carried by document identifiers and avoiding predictable or content-derived identifiers. Treat identifiers and metadata as potentially sensitive, limit their exposure, and use secure-by-default generation that makes identifiers unique and difficult to infer. Apply least-privilege access to document stores and sharing systems, and assess whether encryption and document-generation workflows protect metadata as well as file contents.
How teams detect issues like this
Review PDF-generation code for deterministic, predictable, or content-derived file identifiers, especially in workflows that reuse templates. Test whether identifiers are exposed through document-sharing channels or logs, and assess whether they correlate with placeholder values. Static analysis and code review can flag identifier generation and metadata handling patterns; policy checks can restrict unnecessary exposure of document metadata.

