LOW 3.6

CVE-2026-45380: Off-by-One Path Traversal in bit7z Archive Extraction

bit7z is a C++ library used for archive compression and extraction. Before version 4.0.12, it contained a one-byte error in how it handles symlinks when extracting 7z archives on non-Windows systems. An attacker could craft a malicious archive that creates a symlink pointing outside the intended extraction directory. Once that symlink exists, subsequent files from the same archive could be written to arbitrary locations on the system, potentially overwriting important files or placing malicious content where it will be executed.

Source data · NVD / CISA · public domain

CVSS
3.1 · 3.6 LOW · CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:U/C:N/I:L/A:L
Weaknesses (CWE)
CWE-193, CWE-22
Affected products
0 configuration(s)
Published / Modified
2026-06-10 / 2026-06-17

NVD description (verbatim)

bit7z is a cross-platform C++ static library that allows the compression/extraction of archive files. Prior to version 4.0.12, a one-byte off-by-one error in SafeOutPathBuilder::restoreSymlink() allows an attacker to craft a .7z archive that, when extracted with bit7z on any non-Windows platform, creates a symlink escaping the intended output directory. Subsequent archive entries extracted through this symlink write arbitrary files outside the extraction directory with the permissions of the extracting process. This issue has been patched in version 4.0.12.

3 reference(s) · View on NVD →

SEC.co analysis · AI-assisted, reviewed against source

Technical summary

CVE-2026-45380 stems from an off-by-one error in the SafeOutPathBuilder::restoreSymlink() function within bit7z versions prior to 4.0.12. The vulnerability manifests on Linux, macOS, and other non-Windows platforms where symlink support is native. The flaw allows a specially crafted 7z archive to bypass path canonicalization checks by exactly one byte, enabling creation of a symlink that traverses outside the extraction root directory. Subsequent archive entries processed after symlink creation are then extracted through that escape vector, writing to attacker-controlled paths with the privileges of the extracting process. The vulnerability combines CWE-193 (off-by-one error) with CWE-22 (path traversal).

Business impact

For organizations using bit7z in archive processing workflows—particularly those handling user-supplied or untrusted 7z files—this vulnerability introduces a file integrity and confidentiality risk. The most realistic threat scenario involves an archive processor running as a service account with elevated permissions. An attacker could craft a malicious archive to write files to system directories, inject code into application directories, or corrupt configuration files. However, exploitation requires user interaction (manual extraction or automated processing of untrusted archives) and is limited to non-Windows platforms. The LOW CVSS score reflects these constraints, but the impact can be severe in high-trust extraction environments.

Affected systems

bit7z version 4.0.11 and earlier are vulnerable on Linux, BSD, macOS, and other POSIX-compliant systems where symlink support is available. Windows systems are unaffected because the vulnerable code path is not executed on that platform. Any application statically linking bit7z (as is typical for C++ libraries) and exposing archive extraction functionality to untrusted input is at risk. This includes desktop applications, archiving utilities, backup tools, and server-side processing pipelines.

Exploitability

Exploitation requires two conditions: (1) a non-Windows platform with symlink support, and (2) user interaction or automated processing of attacker-supplied 7z archives. The vulnerability cannot be exploited remotely without a mechanism to deliver the malicious archive to the target system and trigger extraction. The one-byte nature of the error suggests the vulnerability is reliable once properly triggered, but crafting a working proof-of-concept requires understanding of the exact boundary condition. The LOW CVSS score reflects the high bar for practical exploitation in most environments, though high-risk scenarios exist in multi-user systems or service-based extraction platforms.

Remediation

Upgrade bit7z to version 4.0.12 or later. Applications should verify which version of bit7z they have statically linked and rebuild with the patched version. No workarounds exist for earlier versions beyond restricting archive extraction to trusted sources only. Organizations should audit their supply chain to identify all components and applications using bit7z and prioritize patching those exposed to untrusted archives.

Patch guidance

Verify your bit7z version by checking build artifacts, dependency manifests, or library version strings in running processes. The patch was released in version 4.0.12, which addresses the off-by-one error in the symlink restoration logic. Because bit7z is a static library, applications must be recompiled against the patched version; simply updating a system copy of the library (if present) may not protect statically-linked applications. Consult your application vendor for patch availability if you do not control the build process. Testing should confirm that extraction of legitimate archives continues to work correctly and that symlink paths are properly canonicalized.

Detection guidance

Monitor for suspicious symlink creation during archive extraction operations, particularly symlinks that point outside the intended extraction directory. Log and alert on any archive extraction attempts that result in file writes to unexpected system paths. Endpoint detection and response (EDR) tools can track processes creating symlinks followed by file modifications in sensitive directories. On systems where bit7z-based tools are deployed, enable file integrity monitoring on configuration directories and system paths to catch post-extraction modifications. Behavioral indicators include archive extraction followed by rapid filesystem activity in non-extraction directories.

Why prioritize this

While the CVSS score is LOW, prioritization depends on your specific risk profile. If your organization processes untrusted 7z archives—especially through automated pipelines or user-facing tools on Linux/macOS—this should be elevated to medium priority. If you only extract archives from trusted sources or operate primarily on Windows, it can remain low priority. The patching cost is moderate (requires recompilation), making it reasonable to address in your next regular update cycle for affected applications. Inventory your use of bit7z before deciding whether to fast-track the fix.

Risk score, explained

The CVSS 3.1 score of 3.6 (LOW) reflects: local attack vector (AV:L, not network-exploitable), high complexity requiring specific archive crafting (AC:H), no privileges required (PR:N), user interaction necessary (UI:R), and uniform scope with low impact (integrity and availability minimally affected, S:U/I:L/A:L). The score correctly penalizes a vulnerability that is hard to trigger accidentally but could be serious in targeted scenarios. Organizations should not dismiss it based on the score alone; context matters—evaluate whether you fit the high-risk profile.

Frequently asked questions

Does this affect Windows systems?

No. The vulnerable symlink restoration code is not executed on Windows, which uses a different path-handling mechanism. Windows users of bit7z are not at risk from this vulnerability.

What if we only extract archives from trusted sources?

Your risk is significantly reduced but not eliminated. If all archives come from vetted internal sources or verified vendors, exploitation is unlikely. However, if there is any possibility of a supply chain compromise or insider threat, the risk remains. Consider this when determining your patching timeline.

How do I know if my application uses bit7z?

Check your application's documentation, dependency manifest, or licensing disclosures. If you built the application, review your build system's dependencies. For third-party applications, contact the vendor. bit7z is a static library, so it may not appear as a separate installed package—it is compiled into the application binary.

Is there a way to mitigate this without patching?

Mitigation options are limited: restrict archive extraction to processes with minimal privileges, disable symlink creation in the extraction environment if technically feasible, or limit archive extraction to trusted sources only. However, these are imperfect controls. Patching is the proper solution.

This analysis is based on publicly available vulnerability data and vendor advisories as of the publication date. Security ratings and recommendations reflect the information available at the time of writing and may change as new information emerges or as patches are more widely deployed. This is an informational resource and does not constitute professional security advice. Organizations should validate all technical details against their own environments and vendor documentation before taking action. Always test patches in a non-production environment first. SEC.co makes no guarantees regarding the completeness or accuracy of this analysis beyond what is stated in the source vendor advisories. Source: NVD (public-domain), retrieved 2026-07-20. Analysis generated by SEC.co (claude-haiku-4-5).