LiveActive security incident?Get immediate response
CVE Record

CVE-2021-32841: Path Traversal in SharpZipLib

SharpZipLib (or #ziplib) is a Zip, GZip, Tar and BZip2 library. Starting version 1.3.0 and prior to version 1.3.3, a check was added if the destination file is under destination directory. However, it is not enforced that `destDir` ends with slash. If the `destDir` is not slash terminated like `/home/user/dir` it is possible to create a file with a name thats begins with the destination directory, i.e. `/home/user/dir.sh`. Because of the file name and destination directory constraints, the arbitrary file creation impact is limited and depends on the use case. Version 1.3.3 contains a patch for this vulnerability.

MediumCVSS 4Not KEV-listedUpdated
Glexia's TakeAutomated analysismoderate

Security readout for executives and security teams

Plain-English summary

SharpZipLib versions 1.3.0 before 1.3.3 can write files outside the intended extraction directory in a limited way. The impact is integrity-focused: an attacker-controlled archive may create a nearby file whose path begins with the destination directory name. Sources identify a patch in version 1.3.3.

Executive priority

Treat this as a moderate dependency remediation item. It is not presented as remotely exploitable by itself, but archive-processing services can face integrity risk if they accept untrusted files. Upgrade affected dependencies and validate exposed upload or import workflows.

Technical view

This is a CWE-22 path traversal issue in SharpZipLib extraction logic. The destination containment check did not require destDir to end with a slash, allowing paths such as a sibling file prefixed with the destination directory string. CVSS is 4.0, with low integrity impact and no confidentiality or availability impact stated.

Likely exposure

Exposure is most likely in .NET applications using SharpZipLib 1.3.0 through versions before 1.3.3 to extract attacker-supplied archives, especially where destination directories are passed without a trailing slash. Applications not using affected extraction paths or untrusted archives are less likely exposed.

Exploitation context

The provided sources and KEV flag do not show active exploitation. Exploitation requires a vulnerable application flow that extracts crafted archive content with the affected SharpZipLib versions. The documented impact is limited arbitrary file creation constrained by filename and destination directory behavior.

Researcher notes

The key condition is a flawed destination containment check where destDir lacks slash termination. The advisory notes impact is limited by filename and destination directory constraints. Do not broaden scope beyond SharpZipLib versions 1.3.0 before 1.3.3 without separate evidence.

Mitigation direction

  • Upgrade SharpZipLib to version 1.3.3 or later.
  • Check the GitHub Security Lab advisory and vendor release notes.
  • Avoid extracting untrusted archives with affected versions until upgraded.
  • Review extraction code for destination path handling assumptions.
  • Prioritize services that process user-uploaded archives.

Validation and detection

  • Inventory SharpZipLib package versions across source, lockfiles, and deployed artifacts.
  • Confirm no runtime uses versions 1.3.0 through before 1.3.3.
  • Identify features that extract user-supplied Zip, Tar, GZip, or BZip2 content.
  • Review whether extraction destinations rely on string-prefix containment checks.
  • Verify patched builds are deployed where archive extraction is reachable.
Prepared
Confidence
high
Sources
5

Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.

Potential ATT&CK relevance

Conservative CVE-to-ATT&CK context

These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.

ATT&CK lookup starting points

Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.

cwe · medium confidence lookup

CWE-22: File access and web shell behavior lookup

File traversal and upload weaknesses can lead teams to review file, web shell, execution, and collection telemetry. Open the exact CWE lookup page first, then review the ATT&CK searches from that MITRE weakness context. This is a Glexia lookup hint, not an official ATT&CK mapping.

Open ATT&CK lookup
description · low confidence lookup

File access behavior lookup

The CVE wording references file access or upload behavior, so file telemetry and web shell review may help. This is a Glexia inferred lookup path, not an official MITRE, ATT&CK, or CVE Program mapping.

Open ATT&CK lookup
cve · low confidence lookup

CVE-2021-32841 mapping review

Open the CVE-to-ATT&CK bridge for reviewed, inferred, or future official mappings tied to this CVE.

Open ATT&CK lookup
Vulnerability profileCVE Program record
Severity
Medium
CVSS
4 (3.1)
Known Exploited
No
Published

Vector: CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N

Official CVE source material

CNA and ADP enrichment extracted from CVE v5

These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.

1CVSS vectors
0Timeline events
0ADP providers
4Source links

CVSS vector scores

1 official score

We collect every scored CVSS vector available in the official CNA and ADP containers. When more than one version is present, the table keeps the source vectors side by side instead of collapsing them into the highest score.

ScoreVersionSeverityVectorExploitImpactSource
4CVSS 3.1MediumCVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N2.51.4Primary CVE score

Vulnerability scoring details

Base CVSS 3.1 score

4Medium
CVSS 3.1 vector shape for CVE-2021-32841Attack VectorAttack ComplexityPrivileges RequiredUser InteractionScopeConfidentiality ImpactIntegrity ImpactAvailability Impact

Vector: CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N

Attack Vector
NetworkAdjacentLocalPhysical
Attack Complexity
LowHigh
Privileges Required
NoneLowHigh
User Interaction
NoneRequired
Scope
ChangedUnchanged
Confidentiality Impact
HighLowNone
Integrity Impact
HighLowNone
Availability Impact
HighLowNone
Affected products

Products and packages named in the record

VendorProductVersion / packageStatus
icsharpcodesharpziplib1.3.3, 1.3.0Listed
Weakness

CWE details

CWE links open Glexia weakness intelligence pages with official CWE context, developer remediation guidance, and related CVE mappings.

CWE-22 · source CWE mapping

Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')

Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') represents a recurring weakness pattern that can create exploitable paths when design, validation, or implementation controls are missing.