On this page (7 sections)

The Jane PHP libraries, which generate models and API clients from JSON Schema and OpenAPI specifications, have a critical code injection flaw in the jane-php/open-api-3 package. A specially crafted query parameter name in an OpenAPI document can break out of a generated PHPDoc comment and place attacker-controlled PHP into the generated client class. The issue is tracked as CVE-2026-63412 and is fixed in version 7.12.0.

If your project generates API clients from OpenAPI files that you do not fully control (third-party vendor specs, partner APIs, user-supplied documents), you should check your Jane version and any code you generated with it. Projects that only use specs written in-house are at much lower risk, but should still upgrade.

What happened

According to the GitHub advisory, the Jane open-api-3 generator writes an OpenAPI query parameter name into the docblock of generated Client and Endpoint methods exactly as it appears in the spec. Jane builds its PHP output through an abstract syntax tree, so string literals in code are escaped. Comment text, however, is emitted raw.

That gap matters because a PHP docblock ends at the closing comment delimiter. If a parameter name contains that delimiter, the comment ends early and whatever follows is treated as real PHP in the class body. The advisory describes how this can add a __construct method to the generated Client class, which runs as soon as the client is instantiated. Apps typically instantiate the client on every API call, so the injected code would run routinely.

The advisory states it was verified on version 7.11.2 with PHP 8.1, and the report includes a proof of concept. This article does not reproduce it.

Technical details

This is a classic output-encoding problem. The generator trusts a field from the input document and writes it into a context (a code comment) where one particular character sequence has special meaning. The same class of bug appears whenever a tool turns data into source code without neutralizing the syntax of the target language.

The vulnerability record lists the following characteristics:

  • CVSS v4 base score 9.3 (Critical), with attack vector Network, low attack complexity, no privileges required and no user interaction, per the GitHub advisory metrics.
  • High impact to confidentiality, integrity and availability of the vulnerable system.
  • The code runs with the privileges of the application that uses the generated SDK, according to the CVE record description.
  • Exploitation requires two things: generating a client from an attacker-influenced OpenAPI document, and then using the generated client.
The network attack vector in the CVSS score reflects how the malicious document could reach you. The practical risk depends on where your specs come from and whether generated code is reviewed before it is deployed.

The maintainers' fix is in commit 0ea379d, discussed in pull request 960 and shipped in the v7.12.0 release. The advisory's suggested approach is to neutralize the comment-closing sequence in all generated PHPDoc text, including parameter names and descriptions, and to add a regression test for it.

Who is affected

Two groups should pay attention:

  • Developers who run the Jane generator in a build pipeline or on a workstation against OpenAPI specs from outside sources. A malicious spec could plant code in the output at generation time.
  • Anyone who deploys or runs a client that was already generated by a vulnerable version from an untrusted spec. The injected code sits in the generated file and executes on instantiation, so upgrading the library alone does not remove it.

The research does not describe any attacks in the wild, and only one independent publisher (the GitHub advisory itself) covers the story so far. Treat the severity as real, but do not assume that anyone is currently targeting this.

How to check your exposure

First, find out which version of the package your project has installed. Run this from the project root; it prints the installed version of the package, and you are looking for anything below 7.12.0.

Show the installed version of jane-php/open-api-3 (run in the project root)Shell
composer show jane-php/open-api-3

If the package is not a direct dependency, this read-only command shows which installed packages require it and in what version range.

Show which packages depend on jane-php/open-api-3 (run in the project root)Shell
composer why jane-php/open-api-3

Next, review the specs you feed to the generator. Look at where each OpenAPI file comes from, and whether anyone outside your team could have modified it. Then inspect generated Client and Endpoint files for anything unexpected. The following search lists generated files that define a constructor, so you can compare them against what you expect. Adjust the path to your generated output directory.

List generated PHP files that define a __construct method (adjust the path)Shell
grep -rn "function __construct" path/to/generated/

Generated Endpoint classes normally have constructors for their parameters, so a hit alone is not proof of a problem. Look for constructors in classes where you would not expect one, or code that does anything other than assign values. The simplest reliable approach is to regenerate the output with a fixed version and compare it with what you have.

What to do now

  1. Upgrade jane-php/open-api-3 to 7.12.0 or later in every project and build environment that uses it.
  2. Regenerate all clients that were built with an earlier version, especially those built from third-party or user-supplied OpenAPI documents.
  3. Compare the regenerated output with the existing generated code and investigate any differences you cannot explain.
  4. Redeploy the regenerated clients and remove old generated code from build caches and artifacts.
  5. Treat OpenAPI documents from outside your organization as untrusted input: review them before generation and pin them to a known version.
  6. If a suspicious generated file was ever run in production, follow your incident process: rotate secrets available to that application and review logs.

To update the package with Composer, run the following in the project root. It updates only this package within the constraints of your composer.json and prints the version it installed.

Update jane-php/open-api-3 with Composer (run in the project root)Shell
composer update jane-php/open-api-3
Caution. If your composer.json pins an older version constraint, the update command will not reach 7.12.0. Adjust the constraint first, then run your tests before deploying, since generated client code may change between versions.
Tip. Do not generate clients on production servers. Run generation in a CI job with limited credentials and commit or package the reviewed output, so injected code never runs with access to production secrets.

Detection and monitoring afterwards

Because the dangerous step happens at build time and the payload lives in a generated source file, the best control is process-based. Make generated code reviewable: commit it to version control, require pull request review for changes, and diff it whenever the spec or the generator version changes. Unexpected edits to generated Client or Endpoint classes should stand out.

Add a dependency audit to your pipeline so that known-vulnerable Composer packages fail the build, and subscribe to the janephp security advisories for future notices. If your application runs on a public website, regular outside-in checks help you notice unexpected changes in behavior; our website scanner and guide to checking whether a site is hacked cover what can and cannot be seen from outside.

Timeline

Dates as shown on the GitHub advisory
DateEvent
Jul 9, 2026Advisory published to the janephp/janephp repository by the reporter-listed author
Nov 18, 2026Published by the National Vulnerability Database; published to the GitHub Advisory Database
Nov 19, 2026Reviewed and last updated by GitHub
The research does not state the exact release date of 7.12.0, so it is not given here. The fixed version and release tag are linked above.

Sources

This article is based on the public sources below. Details can change as vendors and researchers publish more; check the original advisories before acting on version numbers.

  1. CVE-2026-63412 - GitHub Advisory Databasegithub.com
  • PHP
  • Composer
  • OpenAPI
  • code injection
  • supply chain