CVE-2024-47877
JSON

6.9medium

Extract has insufficient checks allowing attacker to create symlinks outside the extraction directory.

Severity
6.9medium CVSS:4.0 by GitHub_M
Exploit likelihood
0.55% (higher than 47% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-8rm2-93mq-jqhcGO-2024-3196

Description

Extract is aA Go library to extract archives in zip, tar.gz or tar.bz2 formats. A maliciously crafted archive may allow an attacker to create a symlink outside the extraction target directory. This vulnerability is fixed in 4.0.0. If you're using the Extractor.FS interface, then upgrading to /v4 will require to implement the new methods that have been added.

Affected

Product or packageVersionsReported by
codeclysm extract< 4.0.0, before 4.0.0CVE List, NVD
github.com/codeclysm/extract/v3 (Go)up to 3.1.1, all versionsGitHub Advisory Database, Go Vulnerability Database
github.com/codeclysm/extract/v4 (Go)before 4.0.0GitHub Advisory Database, Go Vulnerability Database
github.com/codeclysm/extract (Go)up to 2.2.0, all versionsGitHub Advisory Database, Go Vulnerability Database

All scores

GitHub_M6.9medium CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N
GitHub5.3medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N
GitHubmedium CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N
NVD7.5high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N

Classification

CWE-22CWE-61

SSVC (CISA-ADP): exploitation none, automatable yes, technical impact partial.

What each source says

CVE List

Extract is aA Go library to extract archives in zip, tar.gz or tar.bz2 formats. A maliciously crafted archive may allow an attacker to create a symlink outside the extraction target directory. This vulnerability is fixed in 4.0.0. If you're using the Extractor.FS interface, then upgrading to /v4 will require to implement the new methods that have been added.

GitHub Advisory Database
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.

Go Vulnerability Database

Extract has insufficient checks allowing attacker to create symlinks outside the extraction directory. in github.com/codeclysm/extract

NVD (es)

Extract es una librería Go para extraer archivos en formato zip, tar.gz o tar.bz2. Un archivo manipulado con fines malintencionados puede permitir a un atacante crear un enlace simbólico fuera del directorio de destino de la extracción. Esta vulnerabilidad se ha corregido en la versión 4.0.0. Si utiliza la interfaz Extractor.FS, la actualización a /v4 requerirá la implementación de los nuevos métodos que se han añadido.

References

Sources

SourceRecordLicence
CVE ListCVE-2024-47877 changed 2024-10-11CVE Terms of Use
GitHub Advisory DatabaseGHSA-8rm2-93mq-jqhc changed 2024-10-15CC-BY-4.0
Go Vulnerability DatabaseGO-2024-3196 changed 2026-03-03CC-BY-4.0
NVDCVE-2024-47877 changed 2026-06-17Public domain