Graphify Fortran extractor: incomplete cpp #include hardening allows arbitrary host-file read/exfiltration when indexing an untrusted repo
GHSA-pcc4-rvhr-2pr8 · published 2026-10-19
- Severity
- Medium
- CVSS score
- 6.8
- Chance of exploitation (EPSS)
- No CVE
- Fixed in
- 0.9.70
The Fortran extractor's C-preprocessor step (graphify/extractors/fortran.py, _cpp_preprocess) applies an incomplete #include hardening. The -nostdinc -I /dev/null flags it relies on (comment "Security (F-007)") do not stop a capital-F Fortran source file from including absolute paths (#include "/etc/passwd") or from path-traversing out of the corpus ( ). cpp always searches the directory of the file being preprocessed for quoted includes and always honours absolute include paths, regardless of -nostdinc/-I. …
Upgrade graphifyy to 0.9.70 or later.
Mirror the containment approach already used elsewhere in the codebase (_project_xml_is_safe, security.validate_graph_path): before invoking cpp, scan the source for #include directives and refuse or neutralise any include whose target is absolute or resolves outside the corpus/repo root. Concretely, in _cpp_preprocess: Parse #include "..." / #include directives. Resolve each target against the file's directory; if it is absolute, or its .resolve() escapes the scan root, strip that line (or fall back to path.read_bytes() with no preprocessing). Only allow includes that resolve to a path inside the corpus root. …
-nostdinc only removes the standard system include directories, and -I /dev/null only sets the additional search path. Neither affects: 1. Absolute includes — #include "/etc/passwd" is opened directly by cpp. 2.
| Package | Registry | Affected | Fixed in |
|---|---|---|---|
| graphifyy | PyPI | >= 0.7.2, < 0.9.70 | 0.9.70 |
- CriticalMCP Path Traversal Allows Full-Filesystem Read and JWT Secret Exfiltration Leading to Account Takeoverlangflow, langflow-base
- CriticalVibe-Trading FastAPI endpoints permit unauthenticated access, file upload, and an RCE chainvibe-trading-ai
- Critical@zereight/mcp-gitlab: Unauthenticated arbitrary file read via `upload_markdown` enables PAT exfiltration and full account takeover@zereight/mcp-gitlab
- CriticalFlowise RCE via SQL Database Chain Nodeflowise, flowise-components
- CriticalLangroid: SQLChatAgent dangerous-function blocklist can be bypassed with quoted or schema-qualified pg_read_file callslangroid
- Criticalfast-mcp-telegram: Bearer token path traversal bypasses reserved Telegram session protectionfast-mcp-telegram
The impact, patch and workaround text comes from the advisory, shortened (GitHub Advisory Database, CC BY 4.0). Proof-of-concept and reproduction sections and code are left out; the original advisory has them.