Skip to content

Commit a0f8c28

Browse files
deepin-ci-robothudeng-go
authored andcommitted
fix(plexus-utils2): CVE-2025-67030
Fix Directory Traversal (Zip Slip) vulnerability in Expand.java. Use getCanonicalPath() instead of getAbsolutePath() for proper path validation to prevent directory traversal attacks. Upstream: codehaus-plexus/plexus-utils@36ea352 Generated-By: glm-5.1 Co-Authored-By: hudeng <hudeng@deepin.org>
1 parent 61d928b commit a0f8c28

3 files changed

Lines changed: 45 additions & 0 deletions

File tree

debian/changelog

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
plexus-utils2 (3.4.2-1deepin1) unstable; urgency=medium
2+
3+
* Fix CVE-2025-67030: Directory Traversal vulnerability in Expand.java
4+
5+
-- deepin-ci-robot <packages@deepin.org> Mon, 27 Apr 2026 14:59:56 +0800
6+
17
plexus-utils2 (3.4.2-1) unstable; urgency=medium
28

39
* Team upload.
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
Description: Fix CVE-2025-67030: Directory Traversal vulnerability
2+
Fix Zip Slip vulnerability in archive extraction by using getCanonicalPath()
3+
instead of getAbsolutePath() for path validation.
4+
Author: Copilot <198982749+Copilot@users.noreply.github.com>
5+
Origin: upstream, https://github.com/codehaus-plexus/plexus-utils/commit/36ea3526309d2842075bf018d45152816a37fc98
6+
Bug: https://security-tracker.debian.org/tracker/CVE-2025-67030
7+
Forwarded: not-needed
8+
9+
Index: github-plexus-utils2-67030/src/main/java/org/codehaus/plexus/util/Expand.java
10+
===================================================================
11+
--- github-plexus-utils2-67030.orig/src/main/java/org/codehaus/plexus/util/Expand.java
12+
+++ github-plexus-utils2-67030/src/main/java/org/codehaus/plexus/util/Expand.java
13+
@@ -116,9 +116,23 @@ public class Expand
14+
{
15+
File f = FileUtils.resolveFile( dir, entryName );
16+
17+
- if ( !f.getAbsolutePath().startsWith( dir.getAbsolutePath() ) )
18+
+ try
19+
+ {
20+
+ String canonicalDirPath = dir.getCanonicalPath();
21+
+ String canonicalFilePath = f.getCanonicalPath();
22+
+
23+
+ // Ensure the file is within the target directory
24+
+ // We need to check that the canonical file path starts with the canonical directory path
25+
+ // followed by a file separator to prevent path traversal attacks
26+
+ if ( !canonicalFilePath.startsWith( canonicalDirPath + File.separator )
27+
+ && !canonicalFilePath.equals( canonicalDirPath ) )
28+
+ {
29+
+ throw new IOException( "Entry '" + entryName + "' outside the target directory." );
30+
+ }
31+
+ }
32+
+ catch ( IOException e )
33+
{
34+
- throw new IOException( "Entry '" + entryName + "' outside the target directory." );
35+
+ throw new IOException( "Failed to verify entry path for '" + entryName + "'", e );
36+
}
37+
38+
try

debian/patches/series

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
02-propertyutils-compatibility.patch
33
03-maven-plugin-testing-compatibility.patch
44
06-ignore-jmh-benchmarks.patch
5+
cve_2025_67030.patch

0 commit comments

Comments
 (0)