CVE-2025-0851

9.8 CRITICAL

📋 TL;DR

A path traversal vulnerability in Deep Java Library's ZipUtils.unzip and TarUtils.untar functions allows attackers to write files to arbitrary locations on the filesystem. This affects all platforms running vulnerable versions of DJL. Applications using these functions to process untrusted archive files are at risk.

💻 Affected Systems

Products:
  • Deep Java Library (DJL)
Versions: All versions before v0.31.1
Operating Systems: All platforms (Windows, Linux, macOS)
Default Config Vulnerable: ⚠️ Yes
Notes: Only applications using ZipUtils.unzip or TarUtils.untar with untrusted input are affected. The vulnerability exists in the library itself, not in default configurations of dependent applications.

⚠️ Manual Verification Required

This CVE does not have specific version information in our database, so automatic vulnerability detection cannot determine if your system is affected.

Why? The CVE database entry doesn't specify which versions are vulnerable (no version ranges provided by the vendor/NVD).

🔒 Custom verification scripts are available for registered users. Sign up free to download automated test scripts.

Recommended Actions:
  1. Review the CVE details at NVD
  2. Check vendor security advisories for your specific version
  3. Test if the vulnerability is exploitable in your environment
  4. Consider updating to the latest version as a precaution

⚠️ Risk & Real-World Impact

🔴

Worst Case

Full system compromise via arbitrary file write leading to remote code execution, data exfiltration, or complete system takeover.

🟠

Likely Case

Arbitrary file overwrite leading to data corruption, privilege escalation, or denial of service.

🟢

If Mitigated

Limited impact if only trusted archives are processed and proper file permissions restrict write access.

🌐 Internet-Facing: HIGH - If applications process user-uploaded archives, attackers can exploit remotely without authentication.
🏢 Internal Only: MEDIUM - Internal systems processing untrusted archives remain vulnerable but with reduced attack surface.

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: UNKNOWN
Unauthenticated Exploit: ⚠️ Yes
Complexity: LOW

Exploitation requires the application to process a malicious archive file. No authentication needed if archive processing is exposed to untrusted users.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: v0.31.1

Vendor Advisory: https://github.com/deepjavalibrary/djl/security/advisories/GHSA-jcrp-x7w3-ffmg

Restart Required: Yes

Instructions:

1. Update DJL dependency to version 0.31.1 or later. 2. Update pom.xml or build.gradle to specify the new version. 3. Rebuild and redeploy the application. 4. Restart any running services using the patched library.

🔧 Temporary Workarounds

Input validation and sanitization

all

Validate and sanitize archive file paths before processing to prevent directory traversal.

Sandbox archive extraction

all

Extract archives in isolated directories with restricted permissions.

🧯 If You Can't Patch

  • Disable or restrict access to archive processing functionality
  • Implement strict input validation to reject archives with path traversal sequences

🔍 How to Verify

Check if Vulnerable:

Check if DJL version is below 0.31.1 and if the application uses ZipUtils.unzip or TarUtils.untar with untrusted input.

Check Version:

Check build configuration files (pom.xml, build.gradle) for DJL dependency version.

Verify Fix Applied:

Confirm DJL version is 0.31.1 or higher and test archive processing with malicious path traversal payloads.

📡 Detection & Monitoring

Log Indicators:

  • Unexpected file write operations outside expected extraction directories
  • Archive processing errors with path traversal patterns

Network Indicators:

  • Unusual archive file uploads to vulnerable endpoints

SIEM Query:

Look for file write events with paths containing '../' sequences in application logs.

🔗 References

📤 Share & Export