Vulnerabilities in pkg:golang/github.com/duke-git/lancet

PACKAGE
Advisory Identifier: GHSA-pp3f-xrw5-q5j4
Advisory Summary

CVE-2022-41920 is a HIGH (CVSS 8.8) path traversal vulnerability (CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')) affecting Github.com/duke git/lancet/v2 libraries in the Go ecosystem. The issue involves lancet vulnerable to path traversal when unzipping files. Remediation is available by upgrading affected packages to version 2.1.10, 1.3.4.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:golang/github.com/duke-git/lancet

1 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:golang/github.com/duke-git/lancet. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-pp3f-xrw5-q5j4 CVE-2022-41920 HIGH Lancet vulnerable to path traversal when unzipping files

CVE-2022-41920 at a Glance

CVE Identifier CVE-2022-41920
GHSA Identifier GHSA-pp3f-xrw5-q5j4
Severity HIGH
CVSS v3.1 Base Score 8.8
CWE Classification CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
Affected Product Github.com/duke git/lancet/v2
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 8.8

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:R/S:U/C:H/I:H/A:H).

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

How to Fix CVE-2022-41920

To remediate this vulnerability, upgrade all affected Github.com/duke git/lancet/v2 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/duke-git/lancet/v2 fixed: 2.1.10
Upgrade github.com/duke-git/lancet/v2 to 2.1.10
github.com/duke-git/lancet fixed: 1.3.4
Upgrade github.com/duke-git/lancet to 1.3.4
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/duke-git/lancet/v2

How to Check if You Are Affected

To determine whether your application is affected by CVE-2022-41920, inspect your project dependencies for Github.com/duke git/lancet/v2:

inspect dependencies for github.com/duke-git/lancet/v2

Analyze the terminal output to locate any version of Github.com/duke git/lancet/v2 in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.1.10), 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-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal'), where the product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory. In Github.com/duke git/lancet/v2, 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 _What kind of vulnerability is it? Who is impacted?_ ZipSlip issue when use fileutil package to unzip files. ### Patches _Has the problem been patched? What versions should users upgrade to?_ It will fixed in v2.1.10, Please upgrade version to v2.1.10 or above. Users who use v1.x.x should upgrade v1.3.4 or above. ### Workarounds _Is there a way for users to fix or remediate the vulnerability without upgrading?_ No, users have to upgrade version.

CVE-2022-41920 Affected Github.com/duke git/lancet/v2 Versions

2 component(s)
Fixed Versions:
2.1.101.3.4
Product / Package Ecosystem Affected Versions Fixed Version
github.com/duke-git/lancet/v2
Go
≥ 2.0.0
< 2.1.10
2.1.10
github.com/duke-git/lancet
Go
< 1.3.4
1.3.4

References

Frequently Asked Questions

What is CVE-2022-41920?
CVE-2022-41920 is a security vulnerability in Github.com/duke git/lancet/v2 involving Lancet vulnerable to path traversal when unzipping files under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').
Which Github.com/duke git/lancet/v2 versions are affected?
Affected versions include releases prior to 2.1.10, 1.3.4 across affected packages: github.com/duke-git/lancet/v2, github.com/duke-git/lancet.
What version fixes CVE-2022-41920?
Upgrading to 2.1.10, 1.3.4 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/duke-git/lancet/v2 affected?
Yes, github.com/duke-git/lancet/v2 is affected in releases prior to 2.1.10. Upgrade your dependency to 2.1.10 or later.
Is github.com/duke-git/lancet affected?
Yes, github.com/duke-git/lancet is affected in releases prior to 1.3.4. Upgrade your dependency to 1.3.4 or later.
What is the CVSS score of CVE-2022-41920?
CVE-2022-41920 has a CVSS v3.1 base score of 8.8 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2022-41920?
CVE-2022-41920 is classified under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') (The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory.).
How can I check Go dependencies for CVE-2022-41920?
Run the dependency tree command: 'inspect dependencies for github.com/duke-git/lancet/v2'. 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-pp3f-xrw5-q5j4",
  "modified" : "2023-08-29T19:39:52Z",
  "published" : "2022-11-21T22:31:31Z",
  "aliases" : [ "CVE-2022-41920" ],
  "summary" : "Lancet vulnerable to path traversal when unzipping files",
  "details" : "### Impact\n_What kind of vulnerability is it? Who is impacted?_\n\nZipSlip issue when use fileutil package to unzip files.\n\n### Patches\n_Has the problem been patched? What versions should users upgrade to?_\n\nIt will fixed in v2.1.10, Please upgrade version to v2.1.10 or above.\nUsers who use v1.x.x should upgrade v1.3.4 or above.\n\n### Workarounds\n_Is there a way for users to fix or remediate the vulnerability without upgrading?_\n\nNo, users have to upgrade version.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/duke-git/lancet/v2"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.0.0"
      }, {
        "fixed" : "2.1.10"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/duke-git/lancet"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.3.4"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/duke-git/lancet/security/advisories/GHSA-pp3f-xrw5-q5j4"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-41920"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/duke-git/lancet/issues/62"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/duke-git/lancet/commit/f133b32faa05eb93e66175d01827afa4b7094572"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/duke-git/lancet/commit/f869a0a67098e92d24ddd913e188b32404fa72c9"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/duke-git/lancet"
  }, {
    "type" : "WEB",
    "url" : "https://pkg.go.dev/vuln/GO-2022-1114"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-22" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-11-21T22:31:31Z",
    "nvd_published_at" : "2022-11-17T18:15:00Z"
  }
}