CVE-2023-22899: Zip4j Zip4j Origin Validation Error Vulnerability

MODERATE
Advisory Identifier: GHSA-2pj2-gchf-wmw7
CVSS 5.9
CWE-346
Published
Advisory Summary

CVE-2023-22899 is a MODERATE (CVSS 5.9) zip4j origin validation error vulnerability (CWE-346: Origin Validation Error) affecting Zip4j libraries in the Maven ecosystem. The issue involves zip4j origin validation error. Remediation is available by upgrading affected packages to version 2.11.3.

CVE-2023-22899 at a Glance

CVE Identifier CVE-2023-22899
GHSA Identifier GHSA-2pj2-gchf-wmw7
Severity MODERATE
CVSS v3.1 Base Score 5.9
CWE Classification CWE-346: Origin Validation Error
Affected Product Zip4j
Package Ecosystem Maven
Published Date
Last Updated

Security Impact

CVSS: 5.9

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

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

How to Fix CVE-2023-22899

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

net.lingala.zip4j:zip4j fixed: 2.11.3
<dependency>
    <groupId>net.lingala.zip4j</groupId>
    <artifactId>zip4j</artifactId>
    <version>2.11.3</version>
</dependency>
Verify Direct and Transitive Dependencies

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

mvn dependency:tree -Dincludes=net.lingala.zip4j

How to Check if You Are Affected

To determine whether your Java application is affected by CVE-2023-22899, inspect your build dependencies using the Maven Dependency Plugin:

mvn dependency:tree -Dincludes=net.lingala.zip4j

Analyze the terminal output to locate any version of Zip4j in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.11.3), your application is affected.

Note: The mvn dependency:tree -Dincludes=net.lingala.zip4j command inspects the resolved dependency graph declared in your project's POM files; it does not perform automated security scanning or inspect runtime dynamic classpaths. Always verify runtime container classpaths and shaded JARs.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-346: Origin Validation Error, where the product does not properly verify that the source of data or communication is valid. In Zip4j, 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

Zip4j through 2.11.2, as used in Threema and other products, does not always check the MAC when decrypting a ZIP archive. This issue has been fixed in version 2.11.3.

CVE-2023-22899 Affected Zip4j Versions

1 component(s)
Fixed Versions:
2.11.3
Product / Package Ecosystem Affected Versions Fixed Version
net.lingala.zip4j:zip4j
Maven
< 2.11.3
2.11.3

References

Frequently Asked Questions

What is CVE-2023-22899?
CVE-2023-22899 is a security vulnerability in Zip4j involving Zip4j Origin Validation Error under CWE-346: Origin Validation Error.
Which Zip4j versions are affected?
Affected versions include releases prior to 2.11.3 across affected packages: net.lingala.zip4j:zip4j.
What version fixes CVE-2023-22899?
Upgrading to 2.11.3 (or the latest patched release for your respective branch) resolves the vulnerability.
Is zip4j affected?
Yes, net.lingala.zip4j:zip4j is affected in releases prior to 2.11.3. Upgrade your dependency to 2.11.3 or later.
What is the CVSS score of CVE-2023-22899?
CVE-2023-22899 has a CVSS v3.1 base score of 5.9 (MODERATE) with vector string CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N.
What CWE is associated with CVE-2023-22899?
CVE-2023-22899 is classified under CWE-346: Origin Validation Error (The product does not properly verify that the source of data or communication is valid.).
How can I check Maven dependencies for CVE-2023-22899?
Run the dependency tree command: 'mvn dependency:tree -Dincludes=net.lingala.zip4j'. 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-2pj2-gchf-wmw7",
  "modified" : "2023-01-27T17:41:12Z",
  "published" : "2023-01-10T03:30:29Z",
  "aliases" : [ "CVE-2023-22899" ],
  "summary" : "Zip4j Origin Validation Error",
  "details" : "Zip4j through 2.11.2, as used in Threema and other products, does not always check the MAC when decrypting a ZIP archive. This issue has been fixed in version 2.11.3.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "net.lingala.zip4j:zip4j"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.11.3"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 2.11.2"
    }
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-22899"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/srikanth-lingala/zip4j/issues/485"
  }, {
    "type" : "WEB",
    "url" : "https://breakingthe3ma.app"
  }, {
    "type" : "WEB",
    "url" : "https://breakingthe3ma.app/files/Threema-PST22.pdf"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/srikanth-lingala/zip4j"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/srikanth-lingala/zip4j/releases"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/srikanth-lingala/zip4j/releases/tag/v2.11.3"
  }, {
    "type" : "WEB",
    "url" : "https://news.ycombinator.com/item?id=34316206"
  }, {
    "type" : "WEB",
    "url" : "https://threema.ch/en/blog/posts/news-alleged-weaknesses-statement"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-346" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-01-13T21:34:45Z",
    "nvd_published_at" : "2023-01-10T02:15:00Z"
  }
}