Bug 2283564 (CVE-2024-35219)

Summary: CVE-2024-35219 openapi-generator-online: Path traversal via outputFolder option
Product: [Other] Security Response Reporter: Pedro Sampaio <psampaio>
Component: vulnerabilityAssignee: Product Security <prodsec-ir-bot>
Status: NEW --- QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: chazlett, chfoley, dhanak, dsimansk, gmalinko, janstey, kingland, kverlaen, matzew, mnovotny, pdelbell, pierdipi, rguimara, rhuss, rstepani, swoodman
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: openapi-generator 7.6.0 Doc Type: If docs needed, set a value
Doc Text:
A flaw was found in OpenAPI generator, where it allows the generation of API client libraries, for example, SDK generation, server stubs, documentation, and configuration, automatically given an OpenAPI Spec. This flaw allows an attacker to cause a path traversal vulnerability to read and delete files and folders from an arbitrary, writable directory, as anyone can set the output folder when submitting the request via the `outputFolder` option.
Story Points: ---
Clone Of: Environment:
Last Closed: Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 2283565    

Description Pedro Sampaio 2024-05-27 22:14:59 UTC
OpenAPI Generator allows generation of API client libraries (SDK generation), server stubs, documentation and configuration automatically given an OpenAPI Spec. Prior to version 7.6.0, attackers can exploit a path traversal vulnerability to read and delete files and folders from an arbitrary, writable directory as anyone can set the output folder when submitting the request via the `outputFolder` option. The issue was fixed in version 7.6.0 by removing the usage of the `outputFolder` option. No known workarounds are available.

References:

https://github.com/OpenAPITools/openapi-generator/commit/edbb021aadae47dcfe690313ce5119faf77f800d
https://github.com/OpenAPITools/openapi-generator/pull/18652
https://github.com/OpenAPITools/openapi-generator/security/advisories/GHSA-g3hr-p86p-593h