CVE-2024-24789
📋 TL;DR
This vulnerability in Go's archive/zip package allows attackers to create specially crafted ZIP files that behave differently depending on which ZIP implementation processes them. This could enable file content manipulation or confusion attacks. Affects any Go application that processes ZIP files from untrusted sources.
💻 Affected Systems
- Go programming language
- Applications using Go's archive/zip package
📦 What is this software?
Go by Golang
Go by Golang
⚠️ Risk & Real-World Impact
Worst Case
Attackers could deliver malicious content disguised as legitimate files, potentially leading to data corruption, malware delivery, or bypassing security controls that rely on file validation.
Likely Case
File integrity issues where the same ZIP file yields different contents when processed by different systems, potentially causing application errors or data inconsistencies.
If Mitigated
Limited impact with proper input validation and file source verification in place.
🎯 Exploit Status
Exploitation requires crafting specific invalid ZIP files and targeting applications that process such files without proper validation.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: Go 1.22.6 and Go 1.21.11
Vendor Advisory: https://groups.google.com/g/golang-announce/c/XbxouI9gY7k/m/TuoGEhxIEwAJ
Restart Required: Yes
Instructions:
1. Update Go to version 1.22.6 or 1.21.11. 2. Recompile all affected applications with the updated Go version. 3. Redeploy updated applications. 4. Restart services using the patched applications.
🔧 Temporary Workarounds
Input validation for ZIP files
allImplement strict validation of ZIP files before processing, rejecting files with structural errors or anomalies.
Source verification
allOnly accept ZIP files from trusted, authenticated sources with integrity checks.
🧯 If You Can't Patch
- Implement strict file upload validation and sanitization
- Use alternative ZIP processing libraries with different validation logic
🔍 How to Verify
Check if Vulnerable:
Check Go version with 'go version'. If version is below 1.22.6 (for 1.22.x) or below 1.21.11 (for 1.21.x), the system is vulnerable.
Check Version:
go version
Verify Fix Applied:
After updating, run 'go version' to confirm version is 1.22.6+ or 1.21.11+. Test with known problematic ZIP files to ensure they are rejected.
📡 Detection & Monitoring
Log Indicators:
- Multiple failed ZIP file processing attempts
- Unexpected errors from archive/zip package
- File validation failures for ZIP archives
Network Indicators:
- Unusual ZIP file upload patterns
- Multiple failed upload attempts of ZIP files
SIEM Query:
source="application_logs" AND ("archive/zip" OR "zip processing") AND (error OR failure OR invalid)
🔗 References
- http://www.openwall.com/lists/oss-security/2024/06/04/1
- https://go.dev/cl/585397
- https://go.dev/issue/66869
- https://groups.google.com/g/golang-announce/c/XbxouI9gY7k/m/TuoGEhxIEwAJ
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/U5YAEIA6IUHUNGJ7AIXXPQT6D2GYENX7/
- https://pkg.go.dev/vuln/GO-2024-2888
- http://www.openwall.com/lists/oss-security/2024/06/04/1
- https://go.dev/cl/585397
- https://go.dev/issue/66869
- https://groups.google.com/g/golang-announce/c/XbxouI9gY7k/m/TuoGEhxIEwAJ
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/U5YAEIA6IUHUNGJ7AIXXPQT6D2GYENX7/
- https://pkg.go.dev/vuln/GO-2024-2888
- https://security.netapp.com/advisory/ntap-20250131-0008/