{"id":"EUVD-2021-2087","revision":null,"records":[{"revision":"169baed66c0b4e62bff90b3adc76459f","observedAt":"2026-10-23T15:48:27.903+00:00","statement":{"source":"cve-program","id":"CVE-2021-39208","aliases":[],"title":"WriteEntryToDirectory used for an archive extraction is vulnerable to partial path traversal.","description":"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.","state":0,"publishedAt":"2021-09-16T14:35:11+00:00","modifiedAt":"2024-08-04T01:58:18.179+00:00","affected":[{"ecosystem":"Vendor product","name":"sharpcompress","ranges":[],"versions":[],"rawVersionEvidence":"{\n                    \"product\": \"sharpcompress\",\n                    \"vendor\": \"adamhathcock\",\n                    \"versions\": [\n                        {\n                            \"status\": \"affected\",\n                            \"version\": \"< 0.29.0\"\n                        }\n                    ]\n                }"}],"metrics":[{"system":"CVSS 3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:N","score":4.3,"severity":"MEDIUM"}],"references":["https://github.com/adamhathcock/sharpcompress/security/advisories/GHSA-jp7f-grcv-6mjf","https://github.com/adamhathcock/sharpcompress/pull/614","https://github.com/adamhathcock/sharpcompress/releases/tag/0.29.0"],"sourceUrl":"https://www.cve.org/CVERecord?id=CVE-2021-39208","license":"CVE Program Terms of Use","key":"cve-program:CVE-2021-39208","identifiers":["CVE-2021-39208"]},"retained":false,"historicalAffected":[]},{"revision":"53075a559e6a46c49e18af27c7cafd01","observedAt":"2026-11-24T10:30:34.304+00:00","statement":{"source":"euvd","id":"EUVD-2021-2087","aliases":["CVE-2021-39208","GHSA-jp7f-grcv-6mjf"],"title":"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…","description":"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.","state":0,"publishedAt":null,"modifiedAt":null,"affected":[],"metrics":[{"system":"EUVD CVSS 3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:N","score":4.3,"severity":null}],"references":["https://github.com/adamhathcock/sharpcompress/security/advisories/GHSA-jp7f-grcv-6mjf","https://github.com/adamhathcock/sharpcompress/pull/614","https://github.com/adamhathcock/sharpcompress/releases/tag/0.29.0"],"sourceUrl":"https://euvd.enisa.europa.eu/vulnerability/EUVD-2021-2087","license":"ENISA EUVD · source terms and attribution apply","enrichment":{"sourceStatus":null,"weaknesses":[],"productCriteria":[],"sourceDates":{"datePublished":"Sep 16, 2021, 2:35:11 PM","dateUpdated":"Aug 4, 2024, 1:58:18 AM"},"relatedAdvisories":[],"note":"EUVD source date text has no stated timezone and is retained without inventing a UTC instant. Related bulletin membership is not an alias, common cause or applicability claim. A missing vector with a zero score is treated as unrated. Complete vendor/product and underlying source evidence remains in the original JSON."},"key":"euvd:EUVD-2021-2087","identifiers":["EUVD-2021-2087","CVE-2021-39208","GHSA-jp7f-grcv-6mjf"]},"retained":false,"historicalAffected":[]},{"revision":"dc14fc62f324471cb6ac9b6d0930fbf9","observedAt":"2026-10-24T19:17:25.748+00:00","statement":{"source":"nvd","id":"CVE-2021-39208","aliases":[],"title":"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…","description":"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.","state":0,"publishedAt":"2021-09-16T15:15:07.39+00:00","modifiedAt":"2026-06-17T04:03:18.913+00:00","affected":[],"metrics":[{"system":"CVSS 3.1 · security-advisories@github.com · Secondary","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:N","score":4.3,"severity":"MEDIUM"},{"system":"CVSS 2.0 · nvd@nist.gov · Primary","vector":"AV:N/AC:L/Au:S/C:N/I:P/A:N","score":4,"severity":"MEDIUM"}],"references":["https://github.com/adamhathcock/sharpcompress/pull/614","https://github.com/adamhathcock/sharpcompress/releases/tag/0.29.0","https://github.com/adamhathcock/sharpcompress/security/advisories/GHSA-jp7f-grcv-6mjf"],"sourceUrl":"https://nvd.nist.gov/vuln/detail/CVE-2021-39208","license":"NIST NVD usage terms; underlying source attribution retained","enrichment":{"sourceStatus":"Modified","weaknesses":["CWE-22"],"productCriteria":["cpe:2.3:a:sharpcompress_project:sharpcompress:*:*:*:*:*:*:*:*"],"sourceDates":{"published":"2021-09-16T15:15:07.390","lastModified":"2026-06-17T04:03:18.913"},"relatedAdvisories":[],"note":"NVD analysis and CPE criteria are source context, not proof that a package or your environment is affected. Complete affected data, logical configurations and SSVC are retained in the original JSON."},"key":"nvd:CVE-2021-39208","identifiers":["CVE-2021-39208"]},"retained":false,"historicalAffected":[]},{"revision":"3d0dab72e087400f84014bcc3a25c5a6","observedAt":"2026-10-23T16:01:25.029+00:00","statement":{"source":"osv","id":"GHSA-jp7f-grcv-6mjf","aliases":["CVE-2021-39208"],"title":"Partial path traversal in sharpcompress","description":"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 it is not enforced that fullDestinationDirectoryPath ends with slash:\n\n```csharp\npublic static void WriteEntryToDirectory(IEntry entry,\n                                         string destinationDirectory,\n                                         ExtractionOptions? options,\n                                         Action<string, ExtractionOptions?> write)\n{\n    string destinationFileName;\n    string file = Path.GetFileName(entry.Key);\n    string fullDestinationDirectoryPath = Path.GetFullPath(destinationDirectory);\n...\n        throw new ExtractionException(\"Entry is trying to write a file outside of the destination directory.\");\n}\n```\n\nIf 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.\n\n#### Impact\nBecause of the file name and destination directory constraints the arbitrary file creation impact is limited and depends on the use case.","state":0,"publishedAt":"2021-09-20T19:53:42+00:00","modifiedAt":"2026-07-08T06:29:22.057779+00:00","affected":[{"ecosystem":"NuGet","name":"SharpCompress","ranges":[{"type":"ECOSYSTEM","events":[{"kind":"introduced","version":"0"},{"kind":"fixed","version":"0.29"}]}],"versions":["0.10.0","0.10.1","0.10.1.1","0.10.1.3","0.10.2","0.10.3","0.11.0","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","0.18.1","0.18.2","0.19.0","0.19.1","0.19.2","0.2.0","0.20.0","0.21.0","0.21.1","0.22.0","0.23.0","0.24.0","0.25.0","0.25.1","0.26.0","0.27.0","0.27.1","0.28.0","0.28.1","0.28.2","0.28.3","0.3.0","0.4.0","0.5.0","0.6.0","0.7.0","0.8.0","0.8.1","0.8.2","0.9.0"],"rawVersionEvidence":null}],"metrics":[{"system":"CVSS_V3","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:N","score":null,"severity":null},{"system":"CVSS_V4","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N","score":null,"severity":null},{"system":"Publisher rating","vector":null,"score":null,"severity":"MODERATE"}],"references":["https://github.com/adamhathcock/sharpcompress/security/advisories/GHSA-jp7f-grcv-6mjf","https://nvd.nist.gov/vuln/detail/CVE-2021-39208","https://github.com/adamhathcock/sharpcompress/pull/614","https://github.com/adamhathcock/sharpcompress/commit/ea5c8dc06314c7a5068e7901c51a625224d2b288","https://github.com/adamhathcock/sharpcompress","https://github.com/adamhathcock/sharpcompress/releases/tag/0.29.0"],"sourceUrl":"https://github.com/advisories/GHSA-jp7f-grcv-6mjf","license":"GitHub Advisory Database · CC-BY-4.0","key":"osv:GHSA-jp7f-grcv-6mjf","identifiers":["GHSA-jp7f-grcv-6mjf","CVE-2021-39208"]},"retained":false,"historicalAffected":[]}],"coverage":[{"source":"cisa-kev:global","scope":"Complete CISA KEV catalog; all vendors. Missing entries do not establish absence of exploitation.","generation":"2026-11-25T16:30:51.6399626+00:00","complete":true,"records":1796,"lastAttemptAt":"2026-11-25T16:30:51.6399626+00:00","lastSuccessAt":"2026-11-25T16:30:52.034918+00:00","error":null,"lastVerifiedAt":"2026-11-25T16:30:52.0349214+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"cve-program","scope":"Official CVE Program baseline and cumulative hourly delta; all vendors, published and rejected records","generation":"cve-8d356adab43082cb10bb7c033ed58312cf2ad2f0fb10e0afdf27fc89fa361f3b-eff9d08c8f0fa32ddca8b3faeb4fb15ed8fd3be7ad4cea54f526276594975076","complete":true,"records":432225,"lastAttemptAt":"2026-11-25T16:28:38.1682659+00:00","lastSuccessAt":"2026-11-25T16:28:38.0153955+00:00","error":null,"lastVerifiedAt":"2026-11-25T16:28:38.1682659+00:00","snapshotPublishedAt":"2026-11-25T16:27:14+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"euvd","scope":"Rolling EUVD lookups of CVE aliases in current public OSV archives; 500 identifiers per refresh, rechecked after 48 hours. Not a global EUVD catalog. Successful not-found lookups count as checked; they do not imply withdrawal or safety. No reader inventory is sent.","generation":"enrichment-522d6a60c2c040fb94feb90646b8359a","complete":false,"records":13939,"lastAttemptAt":"2026-11-25T16:33:35.0694599+00:00","lastSuccessAt":"2026-11-25T16:33:35.1374435+00:00","error":null,"lastVerifiedAt":"2026-11-25T16:33:35.1374435+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"first-epss:nuget","scope":"FIRST EPSS for explicit CVE aliases in the collected public NuGet archive. Not a global EPSS backfill.","generation":"2026-11-25T16:30:51.6399626+00:00","complete":true,"records":1131,"lastAttemptAt":"2026-11-25T16:30:51.6399626+00:00","lastSuccessAt":"2026-11-25T16:30:52.035995+00:00","error":null,"lastVerifiedAt":"2026-11-25T16:30:52.0359954+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"nvd","scope":"Rolling NVD lookups of CVE aliases in current public OSV archives; 500 identifiers per refresh, rechecked after 48 hours. Not a global NVD catalog. Successful not-found lookups count as checked; they do not imply withdrawal or safety. No reader inventory is sent.","generation":"enrichment-b1697be945394a11bfe4d90c22645cd8","complete":true,"records":13951,"lastAttemptAt":"2026-11-25T16:30:53.1656546+00:00","lastSuccessAt":"2026-11-25T16:30:53.16+00:00","error":null,"lastVerifiedAt":"2026-11-25T16:30:53.16+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":13987,"expectedIdentifiers":13987,"failedIdentifiers":0},{"source":"osv:Go","scope":"Complete OSV Go ecosystem archive, including withdrawn and malicious-package source records; statement counts are not unique CVE counts","generation":"go-70b1e3058f76fab20c77bb1c4924a4c57f7654dd208befb5b1f237e682d6ddca","complete":true,"records":10077,"lastAttemptAt":"2026-11-25T16:30:51.4950342+00:00","lastSuccessAt":"2026-11-25T11:46:59.5507764+00:00","error":null,"lastVerifiedAt":"2026-11-25T16:30:51.4950342+00:00","snapshotPublishedAt":"2026-11-25T11:03:15+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"osv:NuGet","scope":"Complete OSV NuGet ecosystem archive, including GitHub Advisory Database records; NuGet version matching only","generation":"nuget-6ba2352decd0c95d34a1b50f642582aa34659ce946f552488f0a5cea4e0cc09a","complete":true,"records":2020,"lastAttemptAt":"2026-11-25T16:28:38.3174258+00:00","lastSuccessAt":"2026-11-20T15:46:15.4249619+00:00","error":null,"lastVerifiedAt":"2026-11-25T16:28:38.3174258+00:00","snapshotPublishedAt":"2026-11-20T14:48:20+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"osv:crates.io","scope":"Complete OSV crates.io ecosystem archive, including withdrawn and malicious-package source records; statement counts are not unique CVE counts","generation":"crates.io-5be533520b83c9bfaebc80695093f6f0d59feafc2a1eab94e91dd79d1bb9241b","complete":true,"records":3222,"lastAttemptAt":"2026-11-25T16:30:51.5978795+00:00","lastSuccessAt":"2026-11-25T11:47:03.6026853+00:00","error":null,"lastVerifiedAt":"2026-11-25T16:30:51.5978795+00:00","snapshotPublishedAt":"2026-11-25T11:18:20+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"osv:npm","scope":"Complete OSV npm ecosystem archive, including withdrawn and malicious-package source records; statement counts are not unique CVE counts","generation":"npm-93117e9f4237570c8330a2370f4c3e20e3306a5fa2ad4a5c945eb39d2bbbbbda","complete":true,"records":233129,"lastAttemptAt":"2026-11-25T16:30:51.3700222+00:00","lastSuccessAt":"2026-11-25T16:30:50.1279622+00:00","error":null,"lastVerifiedAt":"2026-11-25T16:30:51.3700222+00:00","snapshotPublishedAt":"2026-11-25T15:33:14+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null}]}