LiveActive security incident?Get immediate response
CVE Record

CVE-2021-32842: Path Traversal in SharpZipLib

SharpZipLib (or #ziplib) is a Zip, GZip, Tar and BZip2 library. Starting version 1.0.0 and prior to version 1.3.3, a check was added if the destination file is under a destination directory. However, it is not enforced that `_baseDirectory` ends with slash. If the _baseDirectory is not slash terminated like `/home/user/dir` it is possible to create a file with a name thats begins as the destination directory one level up from the 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 fixed this vulnerability.

MediumCVSS 4Not KEV-listedUpdated
Glexia's TakeAutomated analysismoderate

Security readout for executives and security teams

Plain-English summary

SharpZipLib could allow a crafted archive extraction to write a file just outside the intended destination directory. The impact is limited by naming constraints, but it can still create unexpected files in some application workflows. Version 1.3.3 fixed the issue.

Executive priority

Treat as a moderate remediation item. It is not documented as actively exploited, but archive extraction bugs can affect integrity-sensitive workflows. Patch during the next normal security update cycle, sooner for systems handling customer-supplied archives.

Technical view

CVE-2021-32842 is a CWE-22 path traversal flaw in SharpZipLib/#ziplib versions 1.0.0 before 1.3.3. The destination containment check did not require the base directory to end with a slash, allowing prefix-confusion writes to a sibling path whose name begins with the destination directory name.

Likely exposure

Exposure is most likely in .NET applications using SharpZipLib before 1.3.3 to extract archives, especially where archive contents are user-controlled or processed automatically. The source describes limited arbitrary file creation, not full arbitrary path write.

Exploitation context

The bundle has no KEV listing and no cited evidence of active exploitation. CVSS 3.1 score is 4.0 with local attack vector and low integrity impact. Real risk depends on how the application chooses extraction paths and handles archive input.

Researcher notes

The key condition is a non-slash-terminated base directory in containment logic. The described write is constrained to paths that begin like the destination directory one level up, so assess impact against each product’s extraction directory, permissions, and post-extraction behavior.

Mitigation direction

  • Upgrade SharpZipLib to version 1.3.3 or later.
  • Identify applications that extract archives using SharpZipLib/#ziplib.
  • Prioritize systems processing untrusted or externally supplied archives.
  • Review vendor advisory and release notes before deployment.
  • Check extraction output locations for unexpected sibling files.

Validation and detection

  • Confirm dependency versions are not below SharpZipLib 1.3.3.
  • Map all code paths that extract archives with SharpZipLib.
  • Verify exposed workflows do not process untrusted archives while unpatched.
  • Review application logs or filesystem changes around extraction jobs.
  • Document compensating controls where upgrade timing is delayed.
Prepared
Confidence
high
Sources
4

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-32842 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
3Source 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-32842Attack 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.0.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.