本文へ移動
English version →
高 7.0

Jane(jane-php)に、細工された$refでローカルファイルを読まれたり内部サービスへ要求されたりする脆弱性

CVE-2026-63415 SecPulse初出

概要

Jane(janephp)の7.12.0より前のバージョンには、OpenAPIの$refの参照先を制限せずに読み込んでしまう脆弱性があります。細工された仕様書からコードを生成すると、ローカルのJSONやYAMLファイルの内容が出力に取り込まれたり、内部サービスへの要求が送られたりするおそれがあります。修正版の7.12.0が公開されています。生成処理を行う環境で、信頼できない仕様書を扱わないよう注意してください。

AI要約

SecPulse が外部の生成 AI を使って作った要約です。誤りを含むことがあります。重要な判断の前に、下の原文と参照URLを確認してください。

Jane(janephp)の7.12.0より前のバージョンには、OpenAPIの$refの参照先を制限せずに読み込んでしまう脆弱性があります。細工された仕様書からコードを生成すると、ローカルのJSONやYAMLファイルの内容が出力に取り込まれたり、内部サービスへの要求が送られたりするおそれがあります。修正版の7.12.0が公開されています。生成処理を行う環境で、信頼できない仕様書を扱わないよう注意してください。

影響パッケージ

パッケージ影響を受ける版 → 修正版
janephpjanephp —
Packagistjane-php/open-api-3
7.12.0 未満→ 7.12.0
原文の説明 取得元が公開している説明をそのまま載せています (多くは英語)。

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.

[maintain…

出典: CVE.org (CVE Program・cvelistV5) NVD GitHub Advisory

参照URL

当サイトでは、アクセス解析と広告の効果測定のためにCookieを使います。株式会社Gameのサイト共通の設定です。 詳しく