CVE-2023-39137: Archive Filename Spoofing Vulnerability

HIGH
Advisory Identifier: GHSA-r285-q736-9v95
CVSS 7.8
CWE-20
Published
Advisory Summary

CVE-2023-39137 is a HIGH (CVSS 7.8) filename spoofing vulnerability (CWE-20: Improper Input Validation) affecting Archive libraries in the Pub ecosystem. The issue involves filename spoofing in archive. Remediation is available by upgrading affected packages to version 3.3.8.

CVE-2023-39137 at a Glance

CVE Identifier CVE-2023-39137
GHSA Identifier GHSA-r285-q736-9v95
Severity HIGH
CVSS v3.1 Base Score 7.8
CWE Classification CWE-20: Improper Input Validation
Affected Product Archive
Package Ecosystem Pub
Published Date
Last Updated

Security Impact

CVSS: 7.8

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

Attack Vector Local (AV:L)
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-2023-39137

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

archive fixed: 3.3.8
Upgrade archive to 3.3.8
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 archive

How to Check if You Are Affected

To determine whether your application is affected by CVE-2023-39137, inspect your project dependencies for Archive:

inspect dependencies for archive

Analyze the terminal output to locate any version of Archive in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.3.8), 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-20: Improper Input Validation, where the product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly. In Archive, 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

An issue in Archive v3.3.7 allows attackers to spoof zip filenames which can lead to inconsistent filename parsing.

CVE-2023-39137 Affected Archive Versions

1 component(s)
Fixed Versions:
3.3.8
Product / Package Ecosystem Affected Versions Fixed Version
archive
Pub
< 3.3.8
3.3.8

References

Frequently Asked Questions

What is CVE-2023-39137?
CVE-2023-39137 is a security vulnerability in Archive involving Filename spoofing in archive under CWE-20: Improper Input Validation.
Which Archive versions are affected?
Affected versions include releases prior to 3.3.8 across affected packages: archive.
What version fixes CVE-2023-39137?
Upgrading to 3.3.8 (or the latest patched release for your respective branch) resolves the vulnerability.
Is archive affected?
Yes, archive is affected in releases prior to 3.3.8. Upgrade your dependency to 3.3.8 or later.
What is the CVSS score of CVE-2023-39137?
CVE-2023-39137 has a CVSS v3.1 base score of 7.8 (HIGH) with vector string CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2023-39137?
CVE-2023-39137 is classified under CWE-20: Improper Input Validation (The product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly.).
How can I check Pub dependencies for CVE-2023-39137?
Run the dependency tree command: 'inspect dependencies for archive'. 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-r285-q736-9v95",
  "modified" : "2024-10-02T13:36:05Z",
  "published" : "2023-08-31T00:30:17Z",
  "aliases" : [ "CVE-2023-39137" ],
  "summary" : "Filename spoofing in archive",
  "details" : "An issue in Archive v3.3.7 allows attackers to spoof zip filenames which can lead to inconsistent filename parsing.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Pub",
      "name" : "archive"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "3.3.8"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 3.3.7"
    }
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-39137"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/brendan-duncan/archive/issues/266"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/brendan-duncan/archive/commit/0d17b270a3c33d3bed56cadd9a43da7717ab11f4"
  }, {
    "type" : "WEB",
    "url" : "https://blog.ostorlab.co/zip-packages-exploitation.html"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/brendan-duncan/archive"
  }, {
    "type" : "WEB",
    "url" : "https://ostorlab.co/vulndb/advisory/OVE-2023-3"
  }, {
    "type" : "WEB",
    "url" : "https://www.rapid7.com/db/modules/exploit/windows/fileformat/winrar_name_spoofing"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-20" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-08-31T01:43:38Z",
    "nvd_published_at" : "2023-08-30T22:15:09Z"
  }
}