NewApp Monitoring is liveSign up free
AgentbeamBeta
Open-source package vulnerability · Go

CVE-2024-47877: Extract has insufficient checks allowing attacker to create symlinks outside the extraction directory.

mediumCVSS 4.0 6.9 · 3.1 5.3GHSA-8rm2-93mq-jqhc

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.

Published Oct 11, 2024

Affected packages

github.com/codeclysm/extract/v3

Ecosystem
Go
Affected
<= 3.1.1
Fixed in
No patched version yet
Check
go list -m github.com/codeclysm/extract/v3

github.com/codeclysm/extract/v4

Ecosystem
Go
Affected
< 4.0.0
Fixed in
4.0.0
Check
go list -m github.com/codeclysm/extract/v4

github.com/codeclysm/extract

Ecosystem
Go
Affected
<= 2.2.0
Fixed in
No patched version yet
Check
go list -m github.com/codeclysm/extract

Advisory details

From the GitHub Advisory Database (CC BY 4.0).

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.

Credited to buglloc, cmaglie.

References

How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology