CVE-2026-63411: Remote Code Execution via PHPDoc Comment Breakout in Jane PHP OpenAPI Generator
Vulnerability ID: CVE-2026-63411
CVSS Score: 9.3
Published: 2026-11-19
CVE-2026-63411 (GHSA-xwcw-j52r-34x4) is a remote code execution vulnerability in the Jane PHP code generation framework (janephp/janephp), specifically affecting the jane-php/open-api-3 component prior to version 7.12.0. The generator constructs PHP docblocks using unsanitized parameter names and descriptions extracted directly from OpenAPI specifications. By embedding the comment closing sequence (*/) followed by valid PHP syntax inside an OpenAPI description or parameter name, an attacker can break out of the PHPDoc context and inject executable code directly into the generated class body. When the consuming application instantiates the generated client or endpoint class, an injected __construct() method executes arbitrary PHP code under the privileges of the host runtime.
TL;DR
Jane PHP prior to version 7.12.0 fails to sanitize OpenAPI parameter descriptions and names before emitting them into PHPDoc comment blocks. An attacker supplying a crafted OpenAPI specification containing the '*/' sequence can break out of the docblock and inject an arbitrary class constructor, achieving remote code execution when the generated SDK client is instantiated.
⚠️ Exploit Status: POC
Technical Details
- CVE ID: CVE-2026-63411 (GHSA-xwcw-j52r-34x4)
- CWE Classification: CWE-94 (Code Injection) / CWE-116 (Improper Escaping)
- CVSS v4.0 Score: 9.3 Critical (CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N)
- EPSS Score: 0.31% (24.63rd Percentile)
- Affected Component: janephp/janephp (jane-php/open-api-3) < 7.12.0
- Attack Vector: PHPDoc Comment Breakout (*/) via Malicious OpenAPI Specification
- Impact: Remote Code Execution upon Generated Client Instantiation
- CISA KEV Status: Not Listed
Affected Systems
- janephp/janephp
- jane-php/open-api-3
- jane-php/open-api-2
- jane-php/open-api-31
- jane-php/json-schema
-
jane-php/open-api-3: < 7.12.0 (Fixed in:
7.12.0) -
janephp/janephp: < 7.12.0 (Fixed in:
7.12.0)
Code Analysis
Commit: 0ea379d
Sanitize PHPDoc to prevent instantiation RCE via */ breakout (#960)
--- a/src/Component/OpenApi3/Generator/Parameter/NonBodyParameterGenerator.php
+++ b/src/Component/OpenApi3/Generator/Parameter/NonBodyParameterGenerator.php
@@ -145,7 +145,7 @@ public function generateMethodDocParameter($parameter, Context $context, string
$type = implode('|', $this->convertParameterType($parameter->getSchema()));
}
- return rtrim(\sprintf(' * @param %s $%s %s', $type, $this->getInflector()->camelize($parameter->getName()), $parameter->getDescription() ?: ''));
+ return rtrim(\sprintf(' * @param %s $%s %s', $type, str_replace('*/', '*\\/', $this->getInflector()->camelize($parameter->getName())), str_replace('*/', '*\\/', $parameter->getDescription() ?: '')));
}
public function generateOptionDocParameter(Parameter $parameter): string
@@ -156,12 +156,12 @@ public function generateOptionDocParameter(Parameter $parameter): string
$type = implode('|', $this->convertParameterType($parameter->getSchema()));
}
- $description = implode("\n", array_map(rtrim(...), explode("\n", $parameter->getDescription() ?: '')));
+ $description = implode("\n", array_map(fn (string $line): string => 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 : ','
Exploit Details
- GitHub: Official patch commit containing regression test PoC (IssuePhpDocInjectionRegressionTest.php) demonstrating __construct() injection via */ breakout.
Mitigation Strategies
- Upgrade Jane PHP OpenAPI and JSON Schema generator packages to version 7.12.0 or later.
- Regenerate all previously compiled PHP SDKs, models, and endpoints using the patched generator.
- Enforce pre-generation schema validation in CI/CD pipelines to reject OpenAPI specifications containing '*/' comment termination sequences.
- Treat third-party and user-supplied OpenAPI specifications as untrusted input and isolate code generation steps within sandboxed build environments.
Remediation Steps:
- Update composer.json to require jane-php/open-api-3 (and related jane-php packages) at version ^7.12.0: composer require jane-php/open-api-3:^7.12.0
- Audit existing generated directories for unexpected __construct declarations or injected code: grep -rn 'function __construct' generated/
- Re-compile all OpenAPI schemas using the updated binary: vendor/bin/jane-openapi generate
- Verify the regenerated diff in version control and deploy the updated client code.
References
- CVE-2026-63411 Record on CVE.org
- NVD Entry for CVE-2026-63411
- GitHub Security Advisory GHSA-xwcw-j52r-34x4
- Official Fix Commit 0ea379deab5689475d62653b408de62ad3611c7a
- Jane PHP Pull Request #960
- Jane PHP Release v7.12.0
- CVEListV5 Official JSON Record
Read the full report for CVE-2026-63411 on our website for more details including interactive diagrams and full exploit analysis.
Top comments (0)