-
CVSS Score
-| Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
|---|---|---|---|
| github.com/hashicorp/go-slug | go | < 0.5.0 | 0.5.0 |
The vulnerability stems from two key issues in the Unpack function: 1) Lack of path traversal validation using cleaned paths and string prefix checks, allowing '../' sequences to escape the target directory. 2) Failure to verify that all parent path components are not symlinks, enabling extraction through malicious symlink chains. The commit 28cafc5 adds both the path validation (strings.HasPrefix) and symlink traversal checks (component-by-component Lstat), confirming these were missing in vulnerable versions. Test cases in slug_test.go demonstrate exploitation via symlink chains and path traversal filenames, which would have been blocked by the added protections.