Vulnerabilities in pkg:golang/github.com/codeclysm/extract

PACKAGE
Advisory Identifier: GHSA-8rm2-93mq-jqhc
Advisory Summary

CVE-2024-47877 is a MODERATE (CVSS 5.3) extract has insufficient checks allowing vulnerability (CWE-61: UNIX Symbolic Link (Symlink) Following) affecting Github.com/codeclysm/extract/v3 libraries in the Go ecosystem. The issue involves extract has insufficient checks allowing attacker to create symlinks outside the extraction directory.. Remediation is available by upgrading affected packages to version 4.0.0.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:golang/github.com/codeclysm/extract

1 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:golang/github.com/codeclysm/extract. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-8rm2-93mq-jqhc CVE-2024-47877 MODERATE Extract has insufficient checks allowing attacker to create symlinks outside the extraction directory.

CVE-2024-47877 at a Glance

CVE Identifier CVE-2024-47877
GHSA Identifier GHSA-8rm2-93mq-jqhc
Severity MODERATE
CVSS v3.1 Base Score 5.3
CWE Classification CWE-61: UNIX Symbolic Link (Symlink) Following
Affected Product Github.com/codeclysm/extract/v3
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 5.3

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity Low (I:L)
Availability None (A:N)

How to Fix CVE-2024-47877

To remediate this vulnerability, upgrade all affected Github.com/codeclysm/extract/v3 dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

github.com/codeclysm/extract/v3 fixed: Latest secure release
Upgrade github.com/codeclysm/extract/v3 to Latest secure release
github.com/codeclysm/extract/v4 fixed: 4.0.0
Upgrade github.com/codeclysm/extract/v4 to 4.0.0
github.com/codeclysm/extract fixed: Latest secure release
Upgrade github.com/codeclysm/extract to Latest secure release
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for github.com/codeclysm/extract/v3

How to Check if You Are Affected

To determine whether your application is affected by CVE-2024-47877, inspect your project dependencies for Github.com/codeclysm/extract/v3:

inspect dependencies for github.com/codeclysm/extract/v3

Analyze the terminal output to locate any version of Github.com/codeclysm/extract/v3 in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 4.0.0), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-61: UNIX Symbolic Link (Symlink) Following, where the product, when opening a file or directory, does not sufficiently account for when the file is a symbolic link that resolves to a target outside of the intended control sphere. this could allow an attacker to cause the product to operate on unauthorized files. In Github.com/codeclysm/extract/v3, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### 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: ```go 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.

CVE-2024-47877 Affected Github.com/codeclysm/extract/v3 Versions

3 component(s)
Fixed Versions:
4.0.0
Product / Package Ecosystem Affected Versions Fixed Version
github.com/codeclysm/extract/v3
Go
≤ 3.1.1
github.com/codeclysm/extract/v4
Go
< 4.0.0
4.0.0
github.com/codeclysm/extract
Go
≤ 2.2.0

References

Frequently Asked Questions

What is CVE-2024-47877?
CVE-2024-47877 is a security vulnerability in Github.com/codeclysm/extract/v3 involving Extract has insufficient checks allowing attacker to create symlinks outside the extraction directory. under CWE-61: UNIX Symbolic Link (Symlink) Following.
Which Github.com/codeclysm/extract/v3 versions are affected?
Affected versions include releases prior to 4.0.0 across affected packages: github.com/codeclysm/extract/v3, github.com/codeclysm/extract/v4, github.com/codeclysm/extract.
What version fixes CVE-2024-47877?
Upgrading to 4.0.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/codeclysm/extract/v3 affected?
Yes, github.com/codeclysm/extract/v3 is affected in releases prior to Latest secure release. Upgrade your dependency to Latest secure release or later.
Is github.com/codeclysm/extract/v4 affected?
Yes, github.com/codeclysm/extract/v4 is affected in releases prior to 4.0.0. Upgrade your dependency to 4.0.0 or later.
What is the CVSS score of CVE-2024-47877?
CVE-2024-47877 has a CVSS v3.1 base score of 5.3 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N.
What CWE is associated with CVE-2024-47877?
CVE-2024-47877 is classified under CWE-61: UNIX Symbolic Link (Symlink) Following (The product, when opening a file or directory, does not sufficiently account for when the file is a symbolic link that resolves to a target outside of the intended control sphere. This could allow an attacker to cause the product to operate on unauthorized files.).
How can I check Go dependencies for CVE-2024-47877?
Run the dependency tree command: 'inspect dependencies for github.com/codeclysm/extract/v3'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-8rm2-93mq-jqhc",
  "modified" : "2024-10-15T19:53:17Z",
  "published" : "2024-10-11T18:10:24Z",
  "aliases" : [ "CVE-2024-47877" ],
  "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",
  "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"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/codeclysm/extract/v3"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "last_affected" : "3.1.1"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/codeclysm/extract/v4"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "4.0.0"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/codeclysm/extract"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "last_affected" : "2.2.0"
      } ]
    } ]
  } ],
  "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" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-10-11T18:10:24Z",
    "nvd_published_at" : "2024-10-11T17:15:04Z"
  }
}