Go Zip Slip Path Traversal
Description
Detects Zip Slip path traversal vulnerabilities in Go applications that handle zip/tar archives. This security issue occurs when malicious archive files can write to arbitrary locations on the filesystem during extraction due to insufficient path validation, potentially allowing attackers to overwrite critical files.
Detection Strategy
• Verifies that archive/zip or archive/tar packages are imported in the Go code
• Identifies file operation methods that are used to extract or write files from archives
• Checks if the file paths from the archive are properly validated before extraction
• Reports a vulnerability when file operations use unsanitized paths from archive entries
Vulnerable code example
package main
import (
"archive/zip"
"io"
"os"
"path/filepath"
)...✅ Secure code example
package main
import (
"archive/zip"
"io"
"os"
"path/filepath"
"strings"...Search for vulnerabilities in your apps for free with Fluid Attacks' automated security testing! Start your 21-day free trial and discover the benefits of the Continuous Hacking Essential plan. If you prefer the Advanced plan, which includes the expertise of Fluid Attacks' hacking team, fill out this contact form.