🛡️ CVE-2026-40180 — quarkus-openapi-generator

🟠 CVSS 7.5 — High ✅ No Known Exploit CWE-22 NVD
7.5
CVSS Score
0 Low4 Medium7 High9 Critical10

Description

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

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.

How this vulnerability can be exploited

This issue can be reached over the network, attack complexity is low, an attacker needs no privileges on the target. No user interaction is required. The scope is unchanged, so the impact stays within the vulnerable component. Rated impact: confidentiality none, integrity high, availability none.

Weakness class

CVE-2026-40180 is classified as CWE-22: Path Traversal. A file path built from user input is not confined to the intended directory, letting an attacker reach files elsewhere on the filesystem.

Affected software

CVE-2026-40180 is recorded against 3 packages.

  • io.quarkiverse.openapi.generator:quarkus-openapi-generator (fixed in 2.16.0)
  • quarkus-openapi-generator
  • unknown

Timeline and source

Published on 8 April 2026 and last revised on 10 April 2026. No public exploit is currently recorded for this entry. A vendor advisory or fix has been published. Record sourced from NVD.

References

github.com (Web)
nvd.nist.gov (Advisory)
github.com (Web)
github.com (Web)
github.com (Package)

Details

Severity High
CVSS Score 7.5
CVSS Vector CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
CWE CWE-22
Public Exploit ✅ No
Source NVD
Published 2026-04-08
Updated 2026-08-12
Modified 2026-04-10

Affected Packages

Software From version Fixed in
io.quarkiverse.openapi.generator:quarkus-openapi-generator 2.16.0
quarkus-openapi-generator
unknown

Similar Threats

Site Security Check

Is quarkus-openapi-generator part of your stack?

CVE-2026-40180 is rated CVSS 7.5 High. BotEraser scans your installation against known CVE records and tells you whether this vulnerability applies to the versions you actually run.

Scan My Site Free →

No credit card required  ·  Results in minutes

ⓘ Data Notice: The information presented above has been compiled from publicly available internet sources. Boteraser aggregates this data solely for informational purposes and does not independently classify, evaluate, or endorse any findings about the vulnerabilities listed. The accuracy and completeness of this information is the sole responsibility of the original publishers. Boteraser and its operators accept no liability for any decisions made based on this data.