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).

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-2025-68924HIGH7.5
  • C#C#
  • UmbracoForms
NoNoJan 16, 2026
GHSA-qp59-x883-77qvMEDIUM6.5
  • C#C#
  • Magick.NET-Q8-OpenMP-x64
NoYesJan 21, 2026
CVE-2026-23952MEDIUM6.5
  • C#C#
  • Magick.NET-Q16-HDRI-x86
NoYesJan 21, 2026
CVE-2026-22770MEDIUM6.5
  • C#C#
  • Magick.NET-Q16-OpenMP-arm64
NoYesJan 20, 2026
CVE-2026-23874MEDIUM5.5
  • C#C#
  • seal-ImageMagick
NoYesJan 20, 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