Summary
Jane: $ref resolution performs SSRF + LFI (path traversal) at code-generation time (jane-php)
Advisory details
Summary
jane-php resolves external $ref targets at code-generation time via file_get_contents($ref) (jane-php/json-schema-runtime/Reference.php::doResolve) with no scheme/path restriction. An attacker-controlled OpenAPI document can therefore cause: $ref: 'http://attacker/x' -> SSRF (HTTP GET at gen time; response inlined = RFI); $ref: '/abs/file' -> LFI; $ref: '../secret.yaml' -> path-traversal LFI (CWE-22, arbitrary local JSON/YAML read). Verified 7.11.2/PHP8.1 (listener records the fetch; remote + ../ local content inlined into the generated code). file:// rejected. CWE-918/CWE-98/CWE-611/CWE-22.
Details
// Reference.php::doResolve()
$contents = file_get_contents($fragment); // $fragment = attacker-controlled $ref URI
Impact
Generating PHP with jane from an attacker-influenced OpenAPI document issues HTTP requests to attacker-chosen URLs (SSRF — internal services, cloud metadata) and reads arbitrary local files (LFI via ../), at build/CI time, inlining results into the output.
PoC
reproduce.sh (+ make_spec.py, gen.php): runs jane on a remote-$ref spec (local listener records the SSRF, output checked for the inlined response) and a ../-traversal local-$ref spec (output checked for the leaked file).
Suggested fix
Disable remote $ref fetching by default (or allow-list); confine local $ref to the spec directory (reject absolute paths and ..). Don't file_get_contents($ref) on attacker-controlled URIs.
References
- https://github.com/advisories/GHSA-c3cj-3p6p-j822
- https://github.com/janephp/janephp/security/advisories/GHSA-c3cj-3p6p-j822
- https://nvd.nist.gov/vuln/detail/CVE-2026-63415
- https://github.com/janephp/janephp/pull/961
- https://github.com/janephp/janephp/commit/75f2bbf79ca2f2eeb13080a2cebded1263396b49
- https://github.com/janephp/janephp/releases/tag/v7.12.0
Related vulnerabilities
All Supply chain →- HIGHCVE-2026-59988
django-docutils unsafe Docutils defaults allow local file disclosure, SSRF, and stored XSS
- HIGHCVE-2026-106557
Backstage has improper input validation in TechDocs Markdown extension configuration
- MEDIUMCVE-2026-59191
TwigView FileLoader may allow arbitrary file reads through user-controlled template paths
- HIGHCVE-2026-77309
AIT-GUI route chain allows unauthenticated Python execution in server process
- MEDIUMCVE-2026-61725
sevenz-rust2: decompress builds each output path as dest.join(entry.name()) with no traversal guard, allowing a crafted .7z to write files outside the destination (Zip-Slip)
- MEDIUMCVE-2026-115565
storyblok-backup: Stored path traversal via unsanitized Storyblok component names in backup output