{"id":2812,"cve":"CVE-2026-119207","cve_url":"https:\/\/www.cvedetails.com\/cve\/CVE-2026-119207\/","cwe":"CWE-400","cwe_number":400,"cwe_url":"https:\/\/cwe.mitre.org\/data\/definitions\/400","cvss_score":7.1,"published":"2026-10-29","owasp":"A08 Software and Data Integrity Failures","odc":"Checking","cdc":"Incorrect Check","category":"Resource Management","subcategory":"Resource Exhaustion","scope":"Remote","impact":"Denial of Service (DoS)","summary":"Excessive memory usage via amplified error messages in pypdf <\u202f6.21.3.","permalink":"https:\/\/netpack.pt\/vaitp\/vulnerability\/CVE-2026-119207\/","description":"pypdf is a free and open-source pure-python PDF library. Prior to 6.21.3, pypdf can consume excessive memory when strict mode loads a crafted invalid PDF dictionary. Nested parsing failures add repeated exception text to newly raised errors, allowing a small malformed dictionary to amplify into very large error messages. This issue is fixed in version 6.21.3.","solution":"Upgrade pypdf to version\u202f6.21.3\u202for later.","affected_component":"pypdf","fixed_by_upgrading":true,"vulnerable_code":"import sys\nfrom io import BytesIO\nfrom pypdf import PdfReader\nfrom pypdf.errors import PdfReadError\n\ndef load_pdf(data: bytes) -> PdfReader:\n    \"\"\"\n    Load a PDF document in strict mode.\n    \"\"\"\n    try:\n        # strict=True triggers detailed parsing errors\n        return PdfReader(BytesIO(data), strict=True)\n    except PdfReadError as e:\n        # VULNERABLE: re\u2011raise with duplicated error text, enabling unbounded memory growth\n        raise PdfReadError(str(e) + \" | \" + str(e)) from None\n","patched_code":"import sys\nfrom io import BytesIO\nfrom pypdf import PdfReader\nfrom pypdf.errors import PdfReadError\n\ndef load_pdf(data: bytes) -> PdfReader:\n    \"\"\"\n    Load a PDF document in strict mode.\n    \"\"\"\n    try:\n        # strict=True triggers detailed parsing errors\n        return PdfReader(BytesIO(data), strict=True)\n    except PdfReadError as e:\n        # FIX: re\u2011raise without concatenating the original message to prevent memory exhaustion\n        raise PdfReadError(str(e)) from None\n","payload_needed":true,"payload":null,"payload_status":"model_refused","published_fix":[{"repository":"py-pdf\/pypdf","commit_url":"https:\/\/github.com\/py-pdf\/pypdf\/commit\/64270258c0eced720f7960aecf8cef31afd39f8d","commit_subject":"SEC: Avoid excessive error messages (#4265)","units":[{"file":".github\/scripts\/check_gh_pages_updates.py","function":"main"},{"file":".github\/scripts\/check_urls.py","function":"check_url"},{"file":"make_release.py","function":"is_semantic_version"},{"file":"pypdf\/generic\/_base.py","function":"FloatObject.__new__"},{"file":"pypdf\/generic\/_base.py","function":"NameObject.read_from_stream"},{"file":"pypdf\/generic\/_base.py","function":"PdfObject._reference_clone"},{"file":"pypdf\/generic\/_data_structures.py","function":"ArrayObject.clone"},{"file":"pypdf\/generic\/_data_structures.py","function":"ContentStream.clone"},{"file":"pypdf\/generic\/_data_structures.py","function":"ContentStream.replicate"},{"file":"pypdf\/generic\/_data_structures.py","function":"Destination.__init__"},{"file":"pypdf\/generic\/_data_structures.py","function":"DictionaryObject.clone"},{"file":"pypdf\/generic\/_data_structures.py","function":"DictionaryObject.read_from_stream"},{"file":"pypdf\/generic\/_data_structures.py","function":"DictionaryObject._clone"},{"file":"pypdf\/generic\/_data_structures.py","function":"StreamObject.replicate"},{"file":"pypdf\/generic\/_data_structures.py","function":"StreamObject._clone"},{"file":"pypdf\/generic\/_data_structures.py","function":"TreeObject.insert_child"},{"file":"pypdf\/generic\/_font.py","function":"Font._get_typographic_maps"},{"file":"pypdf\/generic\/_image_xobject.py","function":"_xobj_to_image"},{"file":"pypdf\/_cmap.py","function":"_derive_character_map_from_cff_type1_font_file"},{"file":"pypdf\/_cmap.py","function":"_parse_encoding"},{"file":"pypdf\/_codecs\/__init__.py","function":"fill_from_encoding"},{"file":"pypdf\/_encryption.py","function":"Encryption._encode_password"},{"file":"pypdf\/_page.py","function":"PageObject._debug_for_extract"},{"file":"pypdf\/_page.py","function":"PageObject._extract_text"},{"file":"pypdf\/_page.py","function":"_VirtualList.__delitem__"},{"file":"pypdf\/_reader.py","function":"PdfReader.get_object"},{"file":"pypdf\/_reader.py","function":"PdfReader.root_object"},{"file":"pypdf\/_reader.py","function":"PdfReader._read_standard_xref_table"},{"file":"pypdf\/_reader.py","function":"PdfReader._read_xref"},{"file":"pypdf\/_reader.py","function":"PdfReader._read_xref_tables_and_trailers"},{"file":"pypdf\/_reader.py","function":"PdfReader._rebuild_xref_table"},{"file":"pypdf\/_text_extraction\/_text_extractor.py","function":"TextExtraction._handle_cm"},{"file":"pypdf\/_text_extraction\/_text_extractor.py","function":"TextExtraction._handle_restore_graphics_state"},{"file":"pypdf\/_text_extraction\/_text_extractor.py","function":"TextExtraction._handle_tf"},{"file":"pypdf\/_writer.py","function":"PdfWriter.reset_translation"},{"file":"pypdf\/_writer.py","function":"PdfWriter.set_need_appearances_writer"},{"file":"pypdf\/_writer.py","function":"PdfWriter._add_page"},{"file":"pypdf\/_writer.py","function":"PdfWriter._get_cloned_page"}]}],"references":null}