CVE-2018-20227: RDF4J vulnerable to zip slip
7.5
CVSS Score
3.0
Basic Information
CVE ID
GHSA ID
EPSS Score
0.82432%
CWE
Published
5/14/2022
Updated
8/16/2024
KEV Status
No
Technology
Java
Technical Details
CVSS Vector
CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
---|---|---|---|
org.eclipse.rdf4j:rdf4j | maven | < 2.5.0 | 2.5.0 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability stems from the writeEntry
function's lack of path normalization/sanitization before writing files. The patch added a critical security check using getCanonicalFile()
.toPath()
.startsWith
(destDir
.toPath()
) to prevent directory traversal. The pre-patch code directly used entry.getName()
to construct output paths, making it vulnerable to zip-slip attacks. The test case added in the commit explicitly tests for this scenario, confirming the function's role in the vulnerability.