{"id":"CVE-2026-40180","aliases":["CVE-2026-40180","GHSA-jx2w-vp7f-456q"],"related":[],"kind":"vulnerability","state":"published","title":"Zip Slip Path Traversal in quarkus-openapi-generator ApicurioCodegenWrapper class","summary":"Quarkus OpenAPI Generator is Quarkus' extensions for generation of Rest Clients and server stubs generation. Prior to 2.16.0 and 2.15.0-lts, 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. This vulnerability is fixed in 2.16.0 and 2.15.0-lts.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Quarkus OpenAPI Generator is Quarkus' extensions for generation of Rest Clients and server stubs generation. Prior to 2.16.0 and 2.15.0-lts, 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. This vulnerability is fixed in 2.16.0 and 2.15.0-lts.","source":"cvelist"},{"lang":"en","text":"### Summary\nA path traversal vulnerability was discovered in the quarkus-openapi-generator extension\n\n### Details\nThe `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.\n\nThe 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.\n\n### PoC\nThis 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.\n\n1. Create a ZIP file containing an entry named `../../proof.txt` with arbitrary content\n2. Configure quarkus-openapi-generator to use the server (Apicurio) code generation path\n3. Serve the malicious ZIP from a controlled or MITM'd Apicurio registry endpoint\n4. Trigger code generation\n5. Observe that `proof.txt` is written two directories above the intended output\n\n\n### Impact\nAn 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.","format":"markdown","source":"ghsa"},{"lang":"es","text":"Quarkus OpenAPI Generator son las extensiones de Quarkus para la generación de clientes Rest y la generación de stubs de servidor. Antes de las versiones 2.16.0 y 2.15.0-lts, el método unzip() en ApicurioCodegenWrapper.java extrae entradas ZIP sin validar que la ruta de archivo resuelta permanezca dentro del directorio de salida previsto. En la línea 101, el destino se construye como new File(toOutputDir, entry.getName()) y el contenido se escribe inmediatamente. Un archivo ZIP malicioso que contenga entradas con secuencias de salto de ruta (por ejemplo, .. / .. / malicious.java) escribiría archivos fuera del directorio objetivo. Esta vulnerabilidad está corregida en las versiones 2.16.0 y 2.15.0-lts.","source":"nvd"}],"published":"2026-04-08T19:14:32.000Z","modified":"2026-10-26T21:10:00.170Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N/E:P","score":7.7,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N/E:P","score":7.7,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:4.0","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","rating":"MEDIUM"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N","score":7.5,"rating":"HIGH"}],"cwes":["CWE-22"],"affected":[{"ranges":[{"version":"< 2.15.0-lts","status":"affected"},{"version":"< 2.16.0","status":"affected"}],"vendor":"quarkiverse","product":"quarkus-openapi-generator","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"2.16.0"}],"ecosystem":"Maven","package":"io.quarkiverse.openapi.generator:quarkus-openapi-generator","purl":"pkg:maven/io.quarkiverse.openapi.generator/quarkus-openapi-generator","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"2.15.0"},{"status":"affected","version":"2.15.0"}],"vendor":"quarkiverse","product":"quarkus_openapi_generator","cpe":"cpe:2.3:a:quarkiverse:quarkus_openapi_generator:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://github.com/quarkiverse/quarkus-openapi-generator/security/advisories/GHSA-jx2w-vp7f-456q","tags":["exploit","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/quarkiverse/quarkus-openapi-generator/commit/08b406414ff30ed192e86c7fa924e57565534ff0","tags":["patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/quarkiverse/quarkus-openapi-generator/commit/e2a9c629a3df719abc74569a3795c265fd0e1239","tags":["patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-40180","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/quarkiverse/quarkus-openapi-generator","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"yes","technicalImpact":"partial","date":"2026-04-13T20:53:43.210Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-40180","url":"https://www.cve.org/CVERecord?id=CVE-2026-40180","licence":"CVE Terms of Use","modified":"2026-04-13T20:53:46.782Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-jx2w-vp7f-456q","url":"https://github.com/advisories/GHSA-jx2w-vp7f-456q","licence":"CC-BY-4.0","modified":"2026-09-10T03:50:44.702Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-40180","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-40180","licence":"Public domain","modified":"2026-10-26T21:10:00.170Z"}],"updatedAt":"2026-11-25T22:59:18.546Z","epss":{"score":0.00411,"percentile":0.37436,"date":"2026-12-01T12:00:22.000Z"}}