Skip to content
← Blog · · df00tech

Jane-PHP OpenAPI Client Generator: PHPDoc Injection Leads to RCE (CVE-2026-63412)

breaking ghsa composer CVE-2026-63412

What Happened

A GitHub Security Advisory (GHSA-q8v2-3j4h-xg2p) discloses a remote code execution vulnerability in jane-php/open-api-3, a PHP SDK generator built on top of nikic/php-parser. According to the report, the library correctly escapes PHP string literals via AST generation. However, it emits PHPDoc comment text, including the OpenAPI query parameter name, raw and unescaped into generated docblocks.

The generator embeds parameter names verbatim inside @param array{"<name>"?: ...} blocks. A parameter name containing */ closes the PHPDoc comment early. The attacker payload then lands in active class-body code. Because the name is treated as a raw string key rather than a sanitized identifier, a crafted sequence like */ public function __construct(){ /* attacker code */ } /* can inject a new constructor into the generated Client class. That constructor runs when the generated client is instantiated, which applications do on effectively every API call. The maintainer-verified PoC targets version 7.11.2 on PHP 8.1. This has been assigned CVE-2026-63412, and a public proof-of-concept is available.

Why It Matters

This is not a vulnerability in hand-written application code. It is in the code generator itself. Any organization that generates PHP SDK clients from OpenAPI specifications using jane-php/open-api-3 is potentially affected if the OpenAPI document's content, parameter names in particular, can be influenced by an untrusted or third-party source. Examples include specs pulled from partner APIs, vendor-supplied schemas, or any pipeline that regenerates clients from externally sourced OpenAPI documents. Because the malicious code lands in the generated Client's constructor, exploitation does not require any unusual usage pattern. Simply instantiating the generated client is enough to trigger execution.

What Defenders Should Watch For

  • Inventory any build or CI pipelines that invoke jane-php/open-api-3 code generation, and identify whether the OpenAPI specs consumed come from external, third-party, or otherwise untrusted sources.
  • Review generated client code for unexpected __construct() methods, especially ones not present in prior generator output, or docblocks that appear truncated or malformed near parameter definitions.
  • As a mitigation until patched, treat OpenAPI specs from external parties as untrusted input. Validate or sanitize parameter names and reject or escape sequences containing */ before running them through the generator.
  • Pin to a patched release once available, then re-generate and diff client code after upgrading to confirm the raw PHPDoc injection path is closed.
  • Audit generated SDKs already in production for suspicious constructors as a retroactive check, particularly where specs originated outside your own organization.

Developing Intel

This advisory was published today and reflects a maintainer-verified report with a working PoC against jane-php/open-api-3 7.11.2 on PHP 8.1. A fix is suggested, which is neutralizing */ sequences in generated PHPDoc text, but deployment status and affected version ranges beyond the tested one are still unclear. Details may evolve as the maintainers respond. Full technical write-up and PoC: GHSA-q8v2-3j4h-xg2p.

Get new detections in your inbox

New ATT&CK coverage plus CISA KEV / CVE detection rules, roughly weekly. No spam, unsubscribe anytime.