GHSA-C3CJ-3P6P-J822

Vulnerability from github – Published: 2026-11-20 00:07 – Updated: 2026-11-20 00:07
VLAI
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

Show details on source website

{
  "affected": [
    {
      "package": {
        "ecosystem": "Packagist",
        "name": "jane-php/open-api-3"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0"
            },
            {
              "fixed": "7.12.0"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [
    "CVE-2026-63415"
  ],
  "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"
  },
  "details": "### Summary\njane-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: \u0027http://attacker/x\u0027` -\u003e SSRF (HTTP GET at gen time; response inlined = RFI); `$ref: \u0027/abs/file\u0027` -\u003e LFI; `$ref: \u0027../secret.yaml\u0027` -\u003e 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.\n\n### Details\n```php\n// Reference.php::doResolve()\n$contents = file_get_contents($fragment); // $fragment = attacker-controlled $ref URI\n```\n\n### Impact\nGenerating PHP with jane from an attacker-influenced OpenAPI document issues HTTP requests to attacker-chosen URLs (SSRF \u2014 internal services, cloud metadata) and reads arbitrary local files (LFI via `../`), at build/CI time, inlining results into the output.\n\n### PoC\n`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).\n\n### Suggested fix\nDisable remote `$ref` fetching by default (or allow-list); confine local `$ref` to the spec directory (reject absolute paths and `..`). Don\u0027t `file_get_contents($ref)` on attacker-controlled URIs.\n\n[maintainer-report.txt](https://github.com/user-attachments/files/29497381/maintainer-report.txt)\n[reproduce.sh](https://github.com/user-attachments/files/29497382/reproduce.sh)\n[gen.php](https://github.com/user-attachments/files/29497384/gen.php)\n[make_spec.py](https://github.com/user-attachments/files/29497385/make_spec.py)",
  "id": "GHSA-c3cj-3p6p-j822",
  "modified": "2026-11-20T00:07:32Z",
  "published": "2026-11-20T00:07:32Z",
  "references": [
    {
      "type": "WEB",
      "url": "https://github.com/janephp/janephp/security/advisories/GHSA-c3cj-3p6p-j822"
    },
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-63415"
    },
    {
      "type": "WEB",
      "url": "https://github.com/janephp/janephp/pull/961"
    },
    {
      "type": "WEB",
      "url": "https://github.com/janephp/janephp/commit/75f2bbf79ca2f2eeb13080a2cebded1263396b49"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/janephp/janephp"
    },
    {
      "type": "WEB",
      "url": "https://github.com/janephp/janephp/releases/tag/v7.12.0"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "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",
      "type": "CVSS_V4"
    }
  ],
  "summary": "Jane: $ref resolution performs SSRF + LFI (path traversal) at code-generation time (jane-php)"
}



Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Forecast uses a logistic model when the trend is rising, or an exponential decay model when the trend is falling. Fitted via linearized least squares.

Sightings

Author Source Type Date Other

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or observed by the user.
  • Confirmed: The vulnerability has been validated from an analyst's perspective.
  • Published Proof of Concept: A public proof of concept is available for this vulnerability.
  • Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
  • Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
  • Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
  • Not confirmed: The user expressed doubt about the validity of the vulnerability.
  • Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.

Loading…

Loading…

Loading…

Related by attack behaviour

Vulnerabilities whose description is nearest to this one in the vector space of the CIRCL/vulnerability-attack-technique-biencoder model. This is a similarity search over the bi-encoder space (plain cosine), not a classification, and it has no measured accuracy.


Loading…