CVE-2021-39208

Source
https://nvd.nist.gov/vuln/detail/CVE-2021-39208
Import Source
https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2021-39208.json
JSON Data
https://api.test.osv.dev/v1/vulns/CVE-2021-39208
Aliases
Published
2021-09-16T15:15:07Z
Modified
2024-10-12T08:20:08.656584Z
Severity
  • 4.3 (Medium) CVSS_V3 - CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:N CVSS Calculator
Summary
[none]
Details

SharpCompress is a fully managed C# library to deal with many compression types and formats. Versions prior to 0.29.0 are vulnerable to partial path traversal. SharpCompress recreates a hierarchy of directories under destinationDirectory if ExtractFullPath is set to true in options. In order to prevent extraction outside the destination directory the destinationFileName path is verified to begin with fullDestinationDirectoryPath. However, prior to version 0.29.0, it is not enforced that fullDestinationDirectoryPath ends with slash. If the destinationDirectory 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. This issue is fixed in SharpCompress version 0.29.0.

References

Affected packages

Git / github.com/adamhathcock/sharpcompress

Affected ranges

Type
GIT
Repo
https://github.com/adamhathcock/sharpcompress
Events
Introduced
0 Unknown introduced commit / All previous commits are affected
Fixed

Affected versions

0.*

0.10
0.10.1
0.10.1.1
0.10.1.2
0.10.1.3
0.10.2
0.10.3
0.11
0.11.1
0.11.2
0.11.3
0.11.4
0.11.5
0.11.6
0.12.0
0.12.1
0.12.2
0.12.3
0.12.4
0.13.0
0.13.1
0.14.0
0.14.1
0.15.0
0.15.1
0.15.2
0.16.0
0.16.1
0.16.2
0.17.0
0.17.1
0.18
0.18.1
0.18.2
0.19
0.19.1
0.19.2
0.20.0
0.21
0.21.0
0.21.1
0.22
0.23
0.24
0.25
0.25.1
0.26
0.27
0.27.1
0.28
0.28.1
0.28.2
0.28.3
0.9