New from Wiz Research: Critical NGINX flaw. Understand the risk and impact.
Vulnerability DatabaseGHSA-639c-rx63-qgmx

GHSA-639c-rx63-qgmx: 
Python vulnerability analysis and mitigation

Package / ecosystem: pip, pyhanko Affected versions: all releases up to and including 0.38.1 (reproduced on every PyPI release from 0.1.0 onwards, except the yanked 0.5.0, which does not import); also present on master at 0ff50825 (2026-11-18). Severity: High. Integrity of the coverage verdict, no confidentiality impact. CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N (7.5) Summary EmbeddedPdfSignature.evaluate_signature_coverage() in pkgs/pyhanko/src/pyhanko/sign/validation/pdf_embedded.py classifies a signature as SignatureCoverageLevel.ENTIRE_FILE when

file_size == len1 + len2 + (len(self.pkcs7_content) * 2 + 2)     # lines ~465-469

where self.pkcs7_content is the decoded value of /Contents (extract_contents(), line ~92, which accepts both ByteStringObject and TextStringObject, i.e. hex and literal strings). In this branch, two things are not checked:

  1. start2 is not compared against len1 + embedded_sig_content. The contiguity check contiguous = start2 == len1 + embedded_sig_content (line ~479) only runs in the subsequent ENTIRE_REVISION branch.
  2. The hole [len1, start2) is not verified to contain exactly one hex string <...> of the expected length. The formula * 2 + 2 assumes hex encoding without whitespace, but a literal string decodes 1:1, and whitespace inside a hex string is skipped during decoding. The CMS blob is then parsed with asn1crypto, which tolerates trailing bytes after the DER structure. So the decoded length need not equal the DER length. Consequence The bytes inside the hole are unsigned. If the decoded length of /Contents is made to differ from what the * 2 + 2 formula assumes, the computed signed_zone_len stops matching the real geometry. The file can then contain bytes outside the signed ranges (e.g. an appended incremental update) while the signature is still reported as ENTIRE_FILE. Because ENTIRE_FILE short-circuits the difference analysis (DiffResult(ModificationLevel.NONE, set()), line ~530), such an update is not reviewed. This does not require any cooperation from the signer, nor access to the signing key: any signed PDF with a hex /Contents (the normal output of pyHanko and other signers) can be altered this way by anyone who obtains a copy. The altered file is non-conforming (PDF Reference 1.7, Table 8.102 requires a hex string for /Contents when /ByteRange is present), but pyHanko's default strict reader accepts it. Proof of concept Starting from a PDF signed by pyHanko with default settings:
  3. Replace the hex string in the hole [len1, start2) with a literal string of the same width, encoding the same CMS bytes (escaping (, ), \ and CR) and padded with NUL bytes. The signed byte ranges and all offsets are unchanged, so the signature remains cryptographically intact. A hole of width 2W + 2 now decodes to roughly 2W bytes instead of W, so the formula expects a file roughly 2W bytes longer than the signed range.
  4. Append an incremental update that replaces the page content stream, padded (e.g. with comment lines) so that the file size equals len1 + len2 + 2 * len(pkcs7_content) + 2. pyHanko then reports the altered file as ENTIRE_FILE / ModificationLevel.NONE, with docmdp_ok and bottom_line both true, summary() giving INTACT:TRUSTED,UNTOUCHED, and pyhanko sign validate exiting with 0. The --pretty-print report is identical to that of the untouched file. Meanwhile, pyHanko's own reader and poppler's pdftotext return the replaced page content. The same incremental update appended without rewriting the hole is correctly reported as ILLEGAL_MODIFICATIONS. Impact Affected: applications that validate signed PDFs with pyHanko and act on bottom_line, coverage, modification_level, docmdp_ok, summary(), or the exit code of pyhanko sign validate or pyhanko sign adesverify. Observed conditions:
  • Same result for single signatures produced by pyHanko, OpenPDF 3.0.5, endesive 3.0.4 and pdfsig 25.03.0 (non-strict reader only for the latter; the strict reader rejects even untouched pdfsig output), and for signatures with Adobe-style revocation data or PAdES B-LT (the later DSS revision is preserved).
  • Room for the appended update ranges from about 6,300 bytes (pyHanko's default reservation) to about 19,900 bytes (pdfsig).
  • Two signatures (two approvals, or certification followed by approval): the earlier signature reports ILLEGAL_MODIFICATIONS and sign validate fails, but a caller validating only the last signature sees it as untouched.
  • Signature followed by a document timestamp: the signature reports ILLEGAL_MODIFICATIONS.
  • PAdES B-LTA, targeting the signature: the signature is reported as untouched and sign validate exits with 0; the document timestamp fails, and the AdES validation result is INDETERMINATE/NO_POE instead of PASSED.
  • Document timestamp only: validate_pdf_timestamp reports ENTIRE_FILE / ModificationLevel.NONE. Context Initially found during a third-party security review (static code audit) of pyHanko 0.38.0 / pyhanko-certvalidator 0.33.0 before adopting it for offline validation of PAdES signatures. Subsequently independently discovered, confirmed and reproduced across releases and signer implementations by Nathan Cross (CyberBadger). Reporters: Julian Neuber; Nathan Cross (CyberBadger)

Source: NVD

Related Python vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2026-132275HIGH7.5
  • Python logoPython
  • svglib
NoYesNov 20, 2026
CVE-2026-132276MEDIUM5.9
  • Python logoPython
  • wcmatch
NoYesNov 20, 2026
CVE-2026-132277MEDIUM5.3
  • Python logoPython
  • inscriptis
NoYesNov 20, 2026
CVE-2026-77332LOW2.3
  • Python logoPython
  • memtomem-stm
NoYesNov 20, 2026
CVE-2026-77331LOW2
  • Python logoPython
  • memtomem-stm
NoYesNov 20, 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

Additional Wiz resources

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