Skip to content

Path Traversal Vulnerability via File Uploads in Genie

Critical
bhou2 published GHSA-wpcv-5jgp-69f3 May 9, 2024

Package

actions Genie OSS (GitHub Actions)

Affected versions

< 4.3.18

Patched versions

4.3.18

Description

Overview

Path Traversal Vulnerability via File Uploads in Genie

Impact

Any Genie OSS users running their own instance and relying on the filesystem to store file attachments submitted to the Genie application may be impacted. Using this technique, it is possible to write a file with any user-specified filename and file contents to any location on the file system that the Java process has write access - potentially leading to remote code execution (RCE).

Genie users who do not store these attachments locally on the underlying file system are not vulnerable to this issue.

Description

Genie's API accepts a multipart/form-data file upload which can be saved to a location on disk. However, it takes a user-supplied filename as part of the request and uses this as the filename when writing the file to disk. Since this filename is user-controlled, it is possible for a malicious actor to manipulate the filename in order to break out of the default attachment storage path and perform path traversal.

Using this technique it is possible to write a file with any user specified name and file contents to any location on the file system that the Java process has write access to.

Patches

This path traversal issue is fixed in Genie OSS v4.3.18. This issue was fixed in #1216 and #1217 and a new release with the fix was created. Please, upgrade your Genie OSS instances to the new version.

Severity

Critical

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
Low
User interaction
None
Scope
Changed
Confidentiality
High
Integrity
High
Availability
Low

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:L

CVE ID

CVE-2024-4701

Weaknesses

Credits