### Key Information - **Vulnerability Name**: Arbitrary Code Execution in pdfminer.six via Crafted PDF Input - **Severity**: High (8.6 / 10) - **CVE ID**: CVE-2025-64512 #### **Main Issues** - **Affected Versions**: - `= 20251107` - **CVSS v3 Base Metrics** - **Attack Vector**: Local - **Attack Complexity**: Low - **Required Privileges**: None - **User Interaction**: Required - **Scope**: Changed - **Confidentiality**: High - **Integrity**: High - **Availability**: High #### **Vulnerability Description** - **Summary**: - pdfminer.six executes arbitrary code from malicious pickle files when processing crafted PDF inputs. - The vulnerability lies in the `CMapDB._load_data()` method, which can be exploited by malicious PDFs referencing `/malicious` CMap paths, leading to code execution. #### **Vulnerability Details** - **Attack Steps**: 1. Create a malicious PDF file with CMap references pointing to a malicious path. 2. Place a malicious pickle file in the specified path. 3. When processing the PDF, pdfminer loads and deserializes the malicious pickle file. 4. This results in execution of arbitrary Python code. - **Exploit Code Snippet**: ```python def _load_data(cls, name: str) -> Any: name = name.replace("\0", "") filename = "%s.pickle.gz" % name return type(str(name), (), pickle.loads(gzfile.read())) ``` - **Malicious Sample**: - A sample malicious PDF is provided, including key descriptions and scripts for the affected component. #### **Impact** - **Linux, macOS**: Hard to exploit - Due to path-specific constraints and lack of support for network storage protocols. - **Windows**: Easy to exploit - Supports protocols like WebDAV and SMB, enabling remote payload encoding. #### **Verification** - Proof-of-Concept (POC) scripts and test instructions are available for validating whether the vulnerability has been fully patched. #### **Remediation Recommendations** - Thoroughly validate data sources during pickle deserialization. - Prefer using security-aware libraries for deserialization operations.