Skip to content
Putting technology to work.
Insights to guide decisions and action.

Search articles

OpenAPI generators: upgrade to Jane 8.1.3 and Refitter 2.4.2

Table of contents · 6 items

If you generate client code from OpenAPI definitions (YAML or JSON files that describe an API's specification), you need to upgrade Jane for PHP to 8.1.3 (released November 20, 2026) and Refitter for .NET to 2.4.2 (released November 22). Both had fixed versions released once in July, but since November, advisories about gaps in those fixes and about code injection from other locations have been published in succession in both repositories: 4 for Jane and 13 for Refitter. For OpenAPI generation in Scala's tapir, the July fixed version 1.13.27 or later remains sufficient, and no advisories have been issued since.

With any of these tools, upgrading alone does not change generated code you have already saved. After upgrading, regenerate the code and check the diff. As of November 24, the November advisories were not listed in the GitHub Advisory Database, so they do not show up in composer audit or NuGet audits. This article covers the number of advisories and the fixed versions, the versions to upgrade to, and the work to do after upgrading.

What happens

All three tools copy names and values from the definition into the source code they generate. If there are places where quotation marks or comment terminators are not escaped at that point, whoever wrote the definition can inject code into the generated code. According to the advisories, the injected code runs at points such as application startup (Refitter's [ModuleInitializer]), when the client or models are used (Jane), or when the generated code is compiled (tapir).

The other issue is the processing that follows $ref (references to other files or URLs) in the definition. It can make the machine running the generator connect to internal URLs, or write the contents of local files into the generated code. Jane and Refitter restricted reference targets in July, but many of the November advisories report that those restrictions can be bypassed with different notations.

This applies if you generate code from definitions you did not write yourself, such as definitions published by business partners or SaaS providers, or definitions fetched from a URL each time.

Advisories and fixed versions

Counts and severities are based on the advisory lists in each project's repository. Dates are when the advisories were published in the repository. Attack steps are omitted.

ToolAdvisory publication dateCount and severityKey featuresFixed version
JaneJuly 9, 20264 (3 critical, 1 high)Code injection that closes PHPDoc comments via parameter names and descriptions; network requests and local file reads via $ref7.12.0
JaneNovember 204 (1 critical, 2 high, 1 medium)Code injection via patternProperties keys, 2 bypasses of the July $ref fix, and object injection via YAML !php/object8.1.3
RefitterJune 29–304 (3 critical, 1 high)Code injection via paths, header names and Content-Type; network requests and file reads via $ref2.1.2 (2.1.1 for the $ref issue)
RefitterNovember 131 (high)Bypasses the $ref check added in 2.1.1 using escaped notation2.4.0
RefitterNovember 171 (critical)Code injection via schema property names, discriminator, default and enum values2.4.1
RefitterNovember 21–2211 (1 critical, 2 high, 8 medium)Code injection via operation keys, bypasses of the $ref check using uppercase letters, symbolic links and similar, credentials sent to another host via paths starting with //, injection into XML documentation, and more2.4.1 (2.4.2 for the XML issue)
tapirJuly 101 (high)Code injection via property and parameter names and tags1.13.27

Here are brief notes on the incomplete fixes and related issues.

  • Jane: The July $ref fix limited reference targets to the directory containing the definition. In November, GHSA-v937-cj22-v527 (high) reports that this check can be bypassed with the file://localhost/... form, and GHSA-wvjc-3xv7-jr55 (medium) reports the same when the definition path is given as a relative path. The critical GHSA-g9m6-r3rx-75h3 concerns a different location from July: code gets into the generated normalizers (normalize() and denormalize()) and runs when models are converted. The advisory states that this location has existed since 7.0.0.
  • Refitter: GHSA-h924-jfhp-9vjr (critical), published November 17, reports that [ModuleInitializer] can likewise be injected through locations the July fix did not escape. It also says that the July advisory's statement that enum and default values were escaped does not hold for some value types. The reporter states that they tested 2.3.1 and a 2.4.0 preview, and did not test earlier versions. The issues bypassing the $ref check are the one from November 13 and seven from November 21–22.

The affected packages have also widened. Many of Refitter's November advisories cover Refitter.Core, Refitter.MSBuild and Refitter.SourceGenerator in addition to the CLI Refitter (some cover only the CLI and Refitter.Core, and some only the CLI). For Jane, jane-php/json-schema, jane-php/json-schema-runtime and jane-php/open-api-common are affected, and the advisories state that jane-php/open-api-3 and others inherit the same processing.

Advisories missing from the database do not show up in audit tools

SourceDate
Publication of advisories in the repositoryRefitter June 29–30 and November 13–22, Jane July 9 and November 20, tapir July 10
Listing in the GitHub Advisory DatabaseOnly the 9 from July (November 19–20)

As of November 24, the 17 advisories published in the repositories in November could not be found in the GitHub Advisory Database. They have not been assigned CVE numbers yet either.

PHP's composer audit checks Packagist's advisory list by default. The only Jane advisories on Packagist were the 4 from July (affecting versions before 7.12.0). The vulnerability information on nuget.org used by .NET's NuGet auditing (dotnet list package --vulnerable and others) also comes from the GitHub Advisory Database, and as of November 24 it included only Refitter's 4 from late June. If you use 7.12.0 or 2.1.2 or later, these tools report nothing. Decide based on the version number.

A diagram with four boxes showing, for each OpenAPI generator, the version to upgrade to and the work after upgrading. Jane: upgrade to 8.1.3. The 8.x series requires PHP 8.3 or later, and there is no 7.x version with fixes for the November advisories. Refitter: upgrade to 2.4.2. Only the 2.4.x series receives fixes, and CLI, MSBuild and SourceGenerator are also affected. tapir: 1.13.27 or later, with 1.14.1 the latest as of November 24. The last box says to regenerate code after upgrading and check the diff

Versions to upgrade to and work after upgrading (editorial proposal)

  1. Check your current versions. For Jane, use composer show 'jane-php/*' or composer.lock to check the versions of jane-php/open-api-3 (or open-api-2 and open-api-3-1), jane-php/json-schema, jane-php/json-schema-runtime and jane-php/open-api-common. Jane's official instructions put the generator in development dependencies (composer require --dev) and the runtime packages in regular dependencies, so check both. For Refitter, check dotnet tool list or .config/dotnet-tools.json, and the Refitter.MSBuild and Refitter.SourceGenerator references in your projects. For tapir, check the version of sbt-openapi-codegen in project/plugins.sbt, or of tapir-openapi-codegen-core.
  2. Decide which version to upgrade to.
    • For Jane, it is 8.1.3. Because jane-php/open-api-3 8.1.3 requires jane-php/json-schema as "^8.0", upgrading only open-api-3 may leave other packages below 8.1.3. Align all packages starting with jane-php/ on 8.1.3. The last 7.x release is 7.14.4, and no 7.x version includes the fixes for the November advisories. The 8.x series requires PHP 8.3 or later, and the shape of the generated client also changes; for example, in 8.0.0 the HTTP client switched from PSR-18 and HTTPlug to Symfony's HttpClient. If you are moving from 7.x, refer to the release notes and the migration skill (jane-upgrade) added to the repository in 8.1.0, and try the upgrade in a test environment first.
    • For Refitter, it is 2.4.2. The repository's security policy states that only the 2.4.x series receives fixes and that fixes are not backported to earlier versions. It states that this applies to all of CLI, MSBuild, SourceGenerator and Core.
    • For tapir, it is 1.13.27 or later. As of November 24, the latest is 1.14.1 (October 26), and there have been no advisories since July.
  3. Regenerate code after upgrading. The advisories say nothing about regeneration. However, injected code and the contents of files that were read are written into the generated files, so upgrading the tool does not change files you have already saved. For code generated with a CLI and kept in your repository (the Jane and Refitter CLIs), regenerate with the upgraded version and check the diff. When code is generated on every build (Refitter.SourceGenerator, Refitter.MSBuild and tapir's sbt plugin), the official documentation says generation happens during the build, so the code is recreated on the first build after upgrading (we have not run this to confirm it).
  4. Inspect code you have already generated. Look for content in files generated from external definitions that could not have come from the definition. For Refitter, look for ModuleInitializer; for Jane, look for code continuing from the middle of a comment or a regular expression string. If the $ref issues apply to you, also check whether the generated code contains the contents of local files or internal services. If you distribute it externally as an SDK, check the versions you have already distributed as well.
  5. Decide on interim measures until you upgrade. These advisories list no workarounds. Within the scope of the advisories, upgrading is the fix. In the meantime, the interim measure is not to generate code from definitions whose contents you have not checked yourself. Do not fetch external definitions directly from a URL; save them to your repository first, review the diff, and then use them. Run generation in an environment with no network access or secrets. It is also important not to enable Jane's allow-external-refs (off by default since 7.12.0) or Refitter's AllowRemoteReferences (off by default), but many of the November advisories report bypasses that work with these defaults unchanged. These measures are not a substitute for upgrading.

We have covered how to share types for API integrations in our article on migrating from OpenAPI to oRPC, the approach of leaving SDK generation to an external service in our article on API client design, and how to think about the time between an advisory's publication and upgrading in our article on Anthropic's vulnerability disclosure.

Scope of verification

On November 24, 2026, we reviewed the advisory lists of the christianhelle/refitter, janephp/janephp and softwaremill/tapir repositories (retrieving all entries via the GitHub API and checking severity, publication date, affected packages and versions, fixed versions and any workarounds), whether each advisory is listed in the GitHub Advisory Database, each project's release notes and Refitter's security policy, the versions and release dates of each package on NuGet, Packagist and Maven Central, Packagist's advisory list, the vulnerability information on nuget.org, the official documentation for Jane, Refitter and tapir, and the Composer and NuGet documentation (desk research). We did not reproduce the issues locally, inspect generated code or perform any upgrades.

GleamHub's development, AI and automation consultations cover integrations with other companies' APIs and reviews of development processes, including code generation setups. Please get in touch via our contact form.

References

Share this articleXFacebook
Kakeru Suzuki

Fascinated by the possibilities of technology, has had a deep interest in programming and digital art since student days

Turn this article's theme into your company's next step

Concrete steps forward for your organization.

We organize your desired architecture, legacy systems, and operational requirements to formulate your next steps toward execution.

  • Desired architecture
  • Integration with existing environments
  • Operational requirements
Consult on development & operations initiatives

You can consult with us from the initial conceptual stage. Details from this article will be carried over to the inquiry form.

Receive the latest articles by email