{"schema_version":"1.9.0","id":"GHSA-8rm2-93mq-jqhc","published":"2024-10-11T18:10:24Z","modified":"2024-10-15T19:53:17Z","aliases":["CVE-2024-47877","GO-2024-3196"],"summary":"Extract has insufficient checks allowing attacker to create symlinks outside the extraction directory.","details":"### Impact\nA maliciously crafted archive may allow an attacker to create a symlink outside the extraction target directory.\n\n### Patches\nPlease use version 4.0.0 or later `github.com/codeclysm/extract/v4`. Any previous version is affected by the bug.\n\n### Workarounds\nNo knows workarounds.\n\n### Backward compatibility notes about upgrading to `/v4` from `/v3`\n\nIf you're not using the `extract.Extractor.FS` interface, you will not face any breaking changes and upgrading should be as simple as changing the import to `/v4`. This should be the case for most of the userbase.\n\nIf you're using the `Extractor.FS` interface, then upgrading to `/v4` will require to implement the new methods that have been added:\n\n```go\ntype FS interface {\n    Link(string, string) error\n    MkdirAll(string, os.FileMode) error\n    OpenFile(name string, flag int, perm os.FileMode) (*os.File, error)\n    Symlink(string, string) error\n\n    // The following methods have been added in the /v4 interface:\n\n    Remove(path string) error\n    Stat(name string) (os.FileInfo, error)\n    Chmod(name string, mode os.FileMode) error\n}\n```\n\nThere should be no other breaking changes in the `/v4` API.\n","affected":[{"package":{"name":"github.com/codeclysm/extract/v3","ecosystem":"Go","purl":"pkg:golang/github.com/codeclysm/extract/v3"},"ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"last_affected":"3.1.1"}]}],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2024/10/GHSA-8rm2-93mq-jqhc/GHSA-8rm2-93mq-jqhc.json"}},{"package":{"name":"github.com/codeclysm/extract/v4","ecosystem":"Go","purl":"pkg:golang/github.com/codeclysm/extract/v4"},"ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"4.0.0"}]}],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2024/10/GHSA-8rm2-93mq-jqhc/GHSA-8rm2-93mq-jqhc.json"}},{"package":{"name":"github.com/codeclysm/extract","ecosystem":"Go","purl":"pkg:golang/github.com/codeclysm/extract"},"ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"last_affected":"2.2.0"}]}],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2024/10/GHSA-8rm2-93mq-jqhc/GHSA-8rm2-93mq-jqhc.json"}}],"references":[{"type":"WEB","url":"https://github.com/codeclysm/extract/security/advisories/GHSA-8rm2-93mq-jqhc"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2024-47877"},{"type":"WEB","url":"https://github.com/codeclysm/extract/commit/4a98568021b8e289345c7f526ccbd7ed732cf286"},{"type":"PACKAGE","url":"https://github.com/codeclysm/extract"}],"database_specific":{"cwe_ids":["CWE-22","CWE-61"],"github_reviewed":true,"github_reviewed_at":"2024-10-11T18:10:24Z","nvd_published_at":"2024-10-11T17:15:04Z","severity":"MODERATE"},"severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N"},{"type":"CVSS_V4","score":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N"}]}