CVE-2024-1485: registry-support: decompress can delete files outside scope via relative paths
8
CVSS Score
3.1
Basic Information
CVE ID
GHSA ID
EPSS Score
0.81242%
CWE
Published
2/14/2024
Updated
11/18/2024
KEV Status
No
Technology
Go
Technical Details
CVSS Vector
CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:N/I:H/A:H
| Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
|---|---|---|---|
| github.com/devfile/registry-support/registry-library | go | < 0.0.0-20240206 | 0.0.0-20240206 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability stems from improper path sanitization in the decompress function. The original code used filepath.Clean on user-controlled header.Name values, which doesn't prevent directory traversal when combined with path.Join. The commit fixes this by introducing CleanFilepath which prepends a '/' to the child path before cleaning, ensuring paths remain contained within the target directory. The removed '#nosec G304' comment and added test cases confirm the vulnerability was in this path construction logic.