DEV Community

CVE Reports
CVE Reports

Posted on Originally published at cvereports.com

CVE-2026-63412: CVE-2026-63412: Remote Code Execution via PHPDoc Comment Injection in Jane PHP OpenAPI Generator

CVE-2026-63412: Remote Code Execution via PHPDoc Comment Injection in Jane PHP OpenAPI Generator

Vulnerability ID: CVE-2026-63412
CVSS Score: 9.3
Published: 2026-11-19

CVE-2026-63412 is a code injection vulnerability in the Jane PHP library suite (affecting jane-php/open-api-3, jane-php/open-api-2, jane-php/open-api-31, and jane-php/json-schema) prior to version 7.12.0. The flaw occurs during the automated generation of PHP client SDKs and data models from OpenAPI specifications. While Jane uses an Abstract Syntax Tree (AST) for safe generation of standard PHP tokens, it constructs PHPDoc comments via raw string interpolation without neutralizing multi-line comment closing delimiters (*/). An attacker who provides or modifies an OpenAPI specification can inject a closing comment sequence inside a query parameter name, escaping the docblock context and writing arbitrary PHP code directly into the class body of generated endpoints or clients. When the consuming application instantiates the generated class, injected methods such as __construct() execute automatically, resulting in remote code execution.

TL;DR

Improper escaping of PHPDoc comment blocks in Jane PHP before version 7.12.0 allows attackers to break out of multi-line comments via crafted OpenAPI parameter names and inject arbitrary executable PHP code into generated client classes.


⚠️ Exploit Status: POC

Technical Details

  • CVE ID: CVE-2026-63412 (GHSA-q8v2-3j4h-xg2p)
  • Weakness Class: CWE-94 (Code Injection) / CWE-116 (Improper Escaping)
  • CVSS v4.0 Score: 9.3 Critical (AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H)
  • EPSS Score: 0.39% (33.98th Percentile)
  • Affected Versions: janephp/janephp < 7.12.0
  • Patched Version: 7.12.0
  • Exploit Status: Public PoC Available
  • CISA KEV Status: Not Listed

Affected Systems

  • jane-php/open-api-3
  • jane-php/open-api-2
  • jane-php/open-api-31
  • jane-php/json-schema
  • janephp/janephp
  • jane-php/open-api-3: < 7.12.0 (Fixed in: 7.12.0)
  • jane-php/open-api-2: < 7.12.0 (Fixed in: 7.12.0)
  • jane-php/open-api-31: < 7.12.0 (Fixed in: 7.12.0)
  • jane-php/json-schema: < 7.12.0 (Fixed in: 7.12.0)

Code Analysis

Commit: 0ea379d

Escape */ sequences as *\/ across OpenAPI 2, OpenAPI 3, OpenAPI 3.1, and JSON Schema docblock generators (PR #960).

--- a/src/Component/OpenApi3/Generator/Parameter/NonBodyParameterGenerator.php
+++ b/src/Component/OpenApi3/Generator/Parameter/NonBodyParameterGenerator.php
@@ -155,11 +155,11 @@ public function generateOptionDocParameter(Parameter $parameter): string
-        $description = implode("\n", array_map(rtrim(...), explode("\n", $parameter->getDescription() ?: '')));
+        $description = implode("\n", array_map(fn ($line) => str_replace('*/', '*\\/', rtrim($line)), explode("\n", $parameter->getDescription() ?: '')));

         return rtrim(
             \sprintf(
                 ' *    "%s"%s: %s%s',
-                $parameter->getName(),
+                str_replace('*/', '*\\/', $parameter->getName()),
                 $parameter->getRequired() ? '' : '?',
                 $type,
                 $description !== '' ? ', //' . $description : ','
             )
         );
Enter fullscreen mode Exit fullscreen mode

Exploit Details

  • GitHub Security Advisory: Official advisory containing proof-of-concept OpenAPI parameter payload demonstrating PHPDoc breakout and constructor injection.

Mitigation Strategies

  • Upgrade all Jane PHP components to version 7.12.0 or later to ensure comment closing delimiters are escaped during docblock generation.
  • Regenerate all previously compiled PHP models, endpoints, and client SDKs after upgrading the generator dependencies.
  • Validate and sanitize untrusted OpenAPI and JSON Schema specifications prior to code generation by rejecting files containing '*/' tokens.
  • Integrate static analysis tools (PHPStan, Psalm) and diff checks into CI/CD pipelines to inspect generated PHP code before deployment.

Remediation Steps:

  1. Run composer update jane-php/* to update jane-php/open-api-3, jane-php/open-api-2, jane-php/open-api-31, and jane-php/json-schema to >= 7.12.0.
  2. Audit existing generated client directories for unexpected method definitions or broken PHPDoc blocks containing */ sequences.
  3. Delete existing generated code directories and execute vendor/bin/jane-openapi generate to rebuild clean SDK files.
  4. Commit the regenerated files and verify application functionality.

References


Read the full report for CVE-2026-63412 on our website for more details including interactive diagrams and full exploit analysis.

Top comments (0)