CVE-2021-32842
C# vulnerability analysis and mitigation

Overview

SharpZipLib (or #ziplib), a Zip, GZip, Tar and BZip2 library, was found to contain a path traversal vulnerability tracked as CVE-2021-32842. The vulnerability affected versions 0.86.0 through 1.3.1, where the ZIP extraction directory path was not enforced to be slash terminated. This security issue was discovered and reported by Jaroslav Lobačevski from the GitHub Security Lab team (GitHub Security Lab).

Technical details

The vulnerability stems from a security check implementation that was added in version 1.0.0 to verify if the destination file is under the destination directory. However, the implementation did not enforce that the _baseDirectory ends with a slash. This oversight meant that if the _baseDirectory path was not slash-terminated (e.g., '/home/user/dir'), it was possible to create a file with a name that begins as the destination directory one level up from the directory (e.g., '/home/user/dir.sh'). The vulnerability is classified as CWE-22 (Path Traversal) (NVD CNA Status).

Impact

The impact of this vulnerability is limited by file name and destination directory constraints. The arbitrary file creation capability depends on the specific use case, but could potentially allow attackers to create files in unintended locations, which might lead to security implications depending on the context of the application (GitHub Security Lab).

Exploitability

The vulnerability could be exploited by crafting specific ZIP files that take advantage of the non-slash-terminated base directory path validation issue. The exploitation would allow creation of files with names that begin with the destination directory path but actually reside one level up from the intended directory (GitHub Security Lab).

Mitigation and workarounds

The vulnerability was fixed in SharpZipLib version 1.3.3, released on September 19, 2021. Users are advised to upgrade to this version or later to address the security issue. The fix includes improvements to path traversal validation (SharpZipLib Release).

Additional resources


SourceThis report was generated using AI

Related C# vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2026-70354HIGH7.8
  • C# logoC#
  • cpe:2.3:a:microsoft:visual_studio_2022
NoYesAug 11, 2026
CVE-2026-62909HIGH7.8
  • C# logoC#
  • dotnet-runtime-10.0
NoYesAug 11, 2026
GHSA-pfvm-w89x-94jwHIGH7.5
  • C# logoC#
  • SIPSorcery
NoYesAug 12, 2026
GHSA-jwjp-4649-v8jpHIGH7.5
  • C# logoC#
  • SIPSorcery
NoYesAug 12, 2026
CVE-2026-48798HIGH7.1
  • C# logoC#
  • SSH.NET
NoYesAug 12, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management