CVE-2024-1163
📋 TL;DR
CVE-2024-1163 is a path traversal vulnerability in mapshaper that allows attackers to access files outside the intended directory, potentially exposing sensitive information. This affects users running vulnerable versions of mapshaper, particularly those processing untrusted input. The vulnerability stems from improper validation of file paths.
💻 Affected Systems
- mapshaper
📦 What is this software?
Mapshaper by Mapshaper
⚠️ Risk & Real-World Impact
Worst Case
Complete system file disclosure including configuration files, credentials, and sensitive data, potentially leading to further compromise.
Likely Case
Disclosure of application files, configuration data, or other accessible files within the server context.
If Mitigated
Limited to non-sensitive file access if proper file permissions and input validation are in place.
🎯 Exploit Status
Exploitation requires the ability to control file path inputs to mapshaper. The fix commit demonstrates the vulnerable pattern.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: Commit 7437d903c0a87802c3751fc529d2de7098094c72 and later
Vendor Advisory: https://github.com/mbloch/mapshaper/commit/7437d903c0a87802c3751fc529d2de7098094c72
Restart Required: No
Instructions:
1. Update mapshaper to the latest version. 2. If using source, apply commit 7437d903c0a87802c3751fc529d2de7098094c72. 3. Rebuild/redeploy the application.
🔧 Temporary Workarounds
Input validation wrapper
allImplement strict input validation for all file paths before passing to mapshaper
# Example: Validate path doesn't contain ../ or absolute paths
# before calling mapshaper functions
Chroot/jail environment
linuxRun mapshaper in a restricted filesystem environment
# Use chroot, containers, or sandboxing to limit filesystem access
🧯 If You Can't Patch
- Implement strict input validation to reject paths containing ../, absolute paths, or other traversal sequences
- Run mapshaper with minimal filesystem permissions and in a restricted environment
🔍 How to Verify
Check if Vulnerable:
Check if mapshaper version is before commit 7437d903c0a87802c3751fc529d2de7098094c72 by examining the source or version metadata
Check Version:
git log --oneline -1 # For source installations, or check package version
Verify Fix Applied:
Verify the commit hash includes 7437d903c0a87802c3751fc529d2de7098094c72 or test with controlled path traversal attempts
📡 Detection & Monitoring
Log Indicators:
- Unusual file access patterns
- Failed path normalization attempts
- Access to files outside expected directories
Network Indicators:
- HTTP requests with ../ sequences in file parameters
- Unusual file read patterns from mapshaper processes
SIEM Query:
source="mapshaper.log" AND ("../" OR "..\\" OR "/etc/" OR "C:\\")