Skip to main content

CVE-2022-41920: CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') in duke-git lancet

Medium
Published: Thu Nov 17 2022 (11/17/2022, 00:00:00 UTC)
Source: CVE
Vendor/Project: duke-git
Product: lancet

Description

Lancet is a general utility library for the go programming language. Affected versions are subject to a ZipSlip issue when using the fileutil package to unzip files. This issue has been addressed and a fix will be included in versions 2.1.10 and 1.3.4. Users are advised to upgrade. There are no known workarounds for this issue.

AI-Powered Analysis

AILast updated: 06/21/2025, 20:53:42 UTC

Technical Analysis

CVE-2022-41920 is a medium-severity vulnerability classified under CWE-22, which pertains to improper limitation of a pathname to a restricted directory, commonly known as a path traversal or ZipSlip vulnerability. This issue affects the 'lancet' utility library developed by duke-git for the Go programming language. Specifically, the vulnerability exists in the fileutil package used for unzipping files. When an application uses the affected versions of lancet to extract ZIP archives, an attacker can craft malicious ZIP files containing file paths with directory traversal sequences (e.g., '../') that cause files to be extracted outside the intended target directory. This can lead to overwriting or creation of arbitrary files anywhere on the filesystem where the application has write permissions. The affected versions include all lancet versions prior to 1.3.4 and versions from 2.0.0 up to but not including 2.1.10. The issue has been addressed in lancet versions 1.3.4 and 2.1.10, with users advised to upgrade accordingly. There are no known workarounds for this vulnerability, and no public exploits have been reported in the wild to date. The vulnerability arises due to insufficient validation or sanitization of file paths during ZIP extraction, allowing attackers to escape the intended extraction directory. This can compromise the integrity and availability of the host system by overwriting critical files or injecting malicious payloads. Since lancet is a general utility library, the impact depends on its usage within applications and services that perform ZIP extraction using the vulnerable versions.

Potential Impact

For European organizations, the impact of CVE-2022-41920 depends largely on the adoption of the lancet library within their software stacks or third-party applications. Organizations using Go-based applications that incorporate lancet for file extraction are at risk of arbitrary file write attacks. Successful exploitation could lead to unauthorized modification or replacement of critical files, potentially enabling further compromise such as privilege escalation, code execution, or denial of service. This is particularly concerning for sectors relying on automated processing of ZIP files, such as software development firms, cloud service providers, and enterprises handling large volumes of compressed data. The vulnerability could also be leveraged in supply chain attacks if malicious ZIP files are introduced into trusted workflows. Although no known exploits exist in the wild, the ease of crafting malicious ZIP archives and the lack of required authentication or user interaction increase the risk profile. European organizations with stringent data integrity and availability requirements, such as financial institutions, healthcare providers, and critical infrastructure operators, could face operational disruptions or data breaches if vulnerable systems are exploited.

Mitigation Recommendations

To mitigate this vulnerability, European organizations should take the following specific actions: 1) Identify all internal and third-party applications that use the lancet library for ZIP file extraction, focusing on versions prior to 1.3.4 and between 2.0.0 and 2.1.10. 2) Upgrade lancet to version 1.3.4 or 2.1.10 (or later) as soon as possible to incorporate the official fix. 3) Implement additional input validation and sanitization on ZIP file paths at the application level to reject archives containing directory traversal sequences before extraction. 4) Employ sandboxing or run extraction processes with least privilege to limit the impact of potential exploitation. 5) Monitor file system changes and audit logs for unexpected file modifications, especially in directories where ZIP files are extracted. 6) Review and harden CI/CD pipelines and software supply chains to prevent introduction of malicious ZIP files. 7) Educate developers and DevOps teams about secure handling of archive files and the risks of path traversal vulnerabilities. These steps go beyond generic patching by emphasizing detection, containment, and secure coding practices tailored to the nature of this vulnerability.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.1
Assigner Short Name
GitHub_M
Date Reserved
2022-09-30T00:00:00.000Z
Cisa Enriched
true

Threat ID: 682d9849c4522896dcbf6d70

Added to database: 5/21/2025, 9:09:29 AM

Last enriched: 6/21/2025, 8:53:42 PM

Last updated: 7/31/2025, 12:13:02 AM

Views: 12

Actions

PRO

Updates to AI analysis are available only with a Pro account. Contact root@offseq.com for access.

Please log in to the Console to use AI analysis features.

Need enhanced features?

Contact root@offseq.com for Pro access with improved analysis and higher rate limits.

Latest Threats