GHSA-8rm2-93mq-jqhc

Suggest an improvement
Source
https://github.com/advisories/GHSA-8rm2-93mq-jqhc
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2024/10/GHSA-8rm2-93mq-jqhc/GHSA-8rm2-93mq-jqhc.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-8rm2-93mq-jqhc
Aliases
Published
2024-10-11T18:10:24Z
Modified
2024-10-15T19:53:17Z
Severity
  • 5.3 (Medium) CVSS_V3 - CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N CVSS Calculator
  • 6.9 (Medium) CVSS_V4 - 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 CVSS Calculator
Summary
Extract has insufficient checks allowing attacker to create symlinks outside the extraction directory.
Details

Impact

A maliciously crafted archive may allow an attacker to create a symlink outside the extraction target directory.

Patches

Please use version 4.0.0 or later github.com/codeclysm/extract/v4. Any previous version is affected by the bug.

Workarounds

No knows workarounds.

Backward compatibility notes about upgrading to /v4 from /v3

If 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.

If you're using the Extractor.FS interface, then upgrading to /v4 will require to implement the new methods that have been added:

type FS interface {
    Link(string, string) error
    MkdirAll(string, os.FileMode) error
    OpenFile(name string, flag int, perm os.FileMode) (*os.File, error)
    Symlink(string, string) error

    // The following methods have been added in the /v4 interface:

    Remove(path string) error
    Stat(name string) (os.FileInfo, error)
    Chmod(name string, mode os.FileMode) error
}

There should be no other breaking changes in the /v4 API.

References

Affected packages

Go / github.com/codeclysm/extract/v3

Package

Name
github.com/codeclysm/extract/v3
View open source insights on deps.dev
Purl
pkg:golang/github.com/codeclysm/extract/v3

Affected ranges

Type
SEMVER
Events
Introduced
0Unknown introduced version / All previous versions are affected
Last affected
3.1.1

Go / github.com/codeclysm/extract/v4

Package

Name
github.com/codeclysm/extract/v4
View open source insights on deps.dev
Purl
pkg:golang/github.com/codeclysm/extract/v4

Affected ranges

Type
SEMVER
Events
Introduced
0Unknown introduced version / All previous versions are affected
Fixed
4.0.0

Go / github.com/codeclysm/extract

Package

Name
github.com/codeclysm/extract
View open source insights on deps.dev
Purl
pkg:golang/github.com/codeclysm/extract

Affected ranges

Type
SEMVER
Events
Introduced
0Unknown introduced version / All previous versions are affected
Last affected
2.2.0