Medium

quarkus-openapi-generator extension has Zip Slip Path Traversal in ApicurioCodegenWrapper class

  • Disclosed: 08.04.2026
  • Updated: 11.10.2026 13:20

Summary

A path traversal vulnerability was discovered in the quarkus-openapi-generator extension

Details

The unzip() method in ApicurioCodegenWrapper.java extracts ZIP entries without validating that the resolved file path stays within the intended output directory. At line 101, the destination is constructed as new File(toOutputDir, entry.getName()) and the content is written immediately. A malicious ZIP archive containing entries with path traversal sequences (e.g., ../../malicious.java) would write files outside the target directory.

The interesting thing is that the client module in the same repository already has the correct fix. OpenApiGeneratorStreamCodeGen.java at line 137 performs proper normalize() and startsWith() validation. The server module was simply missed.

PoC

This vulnerability is exploitable when an attacker controls or can intercept the ZIP archive served by the Apicurio registry. In environments where the registry connection is over an untrusted network or where TLS is not properly configured, exploitation becomes practical. The attack occurs at build/codegen time.

  1. Create a ZIP file containing an entry named ../../proof.txt with arbitrary content
  2. Configure quarkus-openapi-generator to use the server (Apicurio) code generation path
  3. Serve the malicious ZIP from a controlled or MITM'd Apicurio registry endpoint
  4. Trigger code generation
  5. Observe that proof.txt is written two directories above the intended output

Impact

An attacker who can serve a crafted ZIP to the code generation pipeline could write arbitrary files on the build machine. This could overwrite source files, inject malicious code into the build output, or modify configuration files. In CI/CD environments, this could lead to supply chain compromise.

Affected software

Click a technology to see all vulnerabilities affecting it.

PlatformPackageVulnerable versionsFixed in
Java / Kotlin (Maven) io.quarkiverse.openapi.generator:quarkus-openapi-generator < 2.16.0 2.16.0

References

CVSS score -
CVSS vector
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N
Weakness (CWE)
CWE-22
Platform
Java / Kotlin (Maven)
Package
io.quarkiverse.openapi.generator:quarkus-openapi-generator
Disclosed
08.04.2026
Updated
11.10.2026 13:20

Sources and licenses

OSV / GitHub Advisory Database - GHSA-jx2w-vp7f-456q - CC BY 4.0

Vulnerability history: io.quarkiverse.openapi.generator:quarkus-openapi-generator

All published vulnerabilities of this package (Java / Kotlin (Maven)), newest first. Shows whether this is a one-off slip or a package that needs watching.

Total entries
2
First → latest
04.2026 05.2026
Without a fix
0
Exploited in attacks
0

Severity breakdown

  • Medium 2

Disclosures per year

  1. 2026: 2
  1. quarkus-openapi-generator extension has Zip Slip Path Traversal in ApicurioCodegenWrapper class this entry
    Medium CVE-2026-40180 < 2.16.0 2.16.0

Know which vulnerabilities affect your application

With the DockRay integration and software inventory enabled, DockRay checks reported component versions against known vulnerabilities and notifies you about confirmed matches. Coverage depends on the supported technology and available advisory data.

Connect your application
DockRay newsletter

Application security in your inbox

Important vulnerabilities, actionable guidance and practical advice for your applications. Choose your technologies and follow what matters to your project.

  • A daily digest of new vulnerabilities, critical ones included.
  • Notifications about important updates.
  • Practical advice on application security and monitoring.

Leave empty to receive updates for every technology.

Free to subscribe. Unsubscribe with one click in any email.