T08 · Insecure Dependencies
- Location
scripts/extract_pdf.py:84- Finding
Unpinned Third-Party Package Is Resolved and Executed at Runtime
- Content
View full analysis
Vulnerability Details
File Location:
scripts/extract_pdf.py:84-85
Vulnerability Type: Runtime dependency resolution and supply-chain exposure
Risk Level: MediumTechnical Analysis
The extractor invokes
uvxwith the unpinned package specificationmarkitdown[pdf]:python def extract_with_markitdown(pdf_path: Path, output_path: Path, timeout: int) -> dict: uvx = detect_uvx() if not uvx: return { 'ok': False, 'method': 'markitdown', 'error': 'uvx not found', 'install_hint': "python3 -m pip install --user --break-system-packages uv", } ensure_parent(output_path) cmd = [uvx, '--from', 'markitdown[pdf]', 'markitdown', str(pdf_path), '-o', str(output_path)] try: proc = run(cmd, timeout=timeout)Because no exact version, lock file, package hash, or controlled package index is specified, each invocation may resolve a different release and set of transitive dependencies. This makes the effective executable code mutable after the Skill has been reviewed.
The dependency is executed with the same operating-system identity and permissions as the Skill. Although using
uvxis necessary to support the declared extraction workflow, dynamically resolving an unconstrained package exceeds the minimum supply-chain trust required for that functionality.Attack Path
- An attacker compromises a future release of
markitdown, one of its PDF extras, or a transitive dependency available through the configured package index. - An operator invokes the PDF extraction workflow.
uvx --from 'markitdown[pdf]'resolves the affected package version.- Package installation or execution runs attacker-controlled code under the invoking user's account.
- The malicious dependency can access files and resources available to that account, including the PDF being processed and workspace data.
Impact
...[truncated 446 chars]
- An attacker compromises a future release of
- Remediation
View remediation
Remediation Suggestions
- Pin
markitdownand all relevant transitive dependencies to audited versions. - Use a lock file with cryptographic hashes and enforce hash verification during installation.
- Resolve packages from a controlled, trusted index rather than implicitly trusting the runtime environment's configured indexes.
- Prefer a prebuilt, reviewed virtual environment or container instead of resolving dependencies during every extraction.
- Establish an explicit dependency-update process that includes security review and testing.
- Run PDF conversion in a sandbox with restricted filesystem access, network access, process creation, and resource limits.
- Pin
