{"answers":{"affected":"2 open source packages ship an affected version, including SharpZipLib. It affects 1 product.","exploited":"It is not confirmed as exploited in the wild, but public exploit code for CVE-2021-32841 exists.","fix":"Upgrade SharpZipLib to 1.3.3 or later.","what":"CVE-2021-32841 is a medium-severity path traversal vulnerability in icsharpcode sharpziplib, published on 26 Jan 2022. It can only be exploited from the same machine or local network, with no action from the victim."},"fix_prompt":"Check this codebase for CVE-2021-32841 and fix it if it is affected.\n\nWhat it is: CVE-2021-32841 is a medium-severity path traversal vulnerability in icsharpcode sharpziplib, published on 26 Jan 2022. It can only be exploited from the same machine or local network, with no action from the victim.\nExploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2021-32841 exists.\n\nAffected packages and fixed versions:\n- SharpZipLib (NuGet): affected from 1.3.0; fixed in 1.3.3\n- SharpZipLib (NuGet): affected from 1.3.0; fixed in 1.3.3\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/CVE-2021-32841/ (Markdown: https://insights.sbomify.com/CVE-2021-32841/index.md)","id":"CVE-2021-32841","markdown":"https://insights.sbomify.com/CVE-2021-32841/index.md","name":"CVE-2021-32841","record":{"aliases":["GHSA-2x7h-96h5-rq84","UBUNTU-CVE-2021-32841"],"analysis":{"component_type":"library","fix_type":"upgrade","impacts":["data_modify"],"network_reachable":"adjacent_or_local","non_default_config":false,"product_category":"SharpZipLib library","requires_auth":"none","summary":"An attacker can create files outside the intended directory if the destination path lacks a trailing slash, potentially overwriting or creating unintended files.","user_interaction":"not_required","vuln_class":"path_traversal"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"GitHub_M","cpe":[{"product":"sharpziplib","vendor":"sharpziplib_project"}],"cvss":{"score":4,"severity":"medium","source":"cna","vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N","version":"3.1"},"cwes":[{"id":"CWE-22","name":"Improper Limitation of a Pathname to a Restricted Directory"}],"description":"SharpZipLib (or #ziplib) is a Zip, GZip, Tar and BZip2 library. Starting version 1.3.0 and prior to version 1.3.3, a check was added if the destination file is under destination directory. However, it is not enforced that `destDir` ends with slash. If the `destDir` is not slash terminated like `/home/user/dir` it is possible to create a file with a name thats begins with the destination 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 contains a patch for this vulnerability.","ecosystems":["NuGet"],"exploits":{"exploitdb":0,"first_seen":null,"github_poc":0,"max_poc_stars":null,"metasploit":0,"nuclei":0,"refs":[],"tier":"weaponised"},"has_fix":true,"headline":"Path Traversal in SharpZipLib","id":"CVE-2021-32841","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"NuGet","product":null,"products":[],"type":"path_traversal","year":"2021"},"n_packages":2,"n_references":3,"next":{"headline":"Path Traversal in SharpZipLib","id":"CVE-2021-32842"},"packages":[{"ecosystem":"NuGet","fixed":["1.3.3"],"introduced":["1.3.0"],"last_affected":[],"package":"SharpZipLib","purl":null,"source":"GHSA-2x7h-96h5-rq84"},{"ecosystem":"NuGet","fixed":["1.3.3"],"introduced":["1.3.0"],"last_affected":[],"package":"SharpZipLib","purl":"pkg:nuget/SharpZipLib","source":"GHSA-2x7h-96h5-rq84"}],"prev":{"headline":"Path Traversal in SharpZipLib","id":"CVE-2021-32840"},"products":["sharpziplib"],"published":"2022-01-26","related":[{"cvss_score":7.3,"headline":"Path Traversal in SharpZipLib","id":"CVE-2021-32840","kev_date_added":null,"published":"2022-01-26"},{"cvss_score":5.5,"headline":"Improper Limitation of a Pathname to a Restricted Directory in SharpZipLib","id":"CVE-2018-1002208","kev_date_added":null,"published":"2018-07-25"},{"cvss_score":4,"headline":"Path Traversal in SharpZipLib","id":"CVE-2021-32842","kev_date_added":null,"published":"2022-01-26"}],"sources":[{"class":"attribution","licence":"CVE Terms of Use (MITRE)","name":"CVE List","prefix":"CVE"},{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"},{"class":"attribution","licence":"US public information, NVD API terms","name":"NVD"},{"class":"attribution","licence":"CWE Terms of Use","name":"CWE (MITRE)"},{"class":"attribution","licence":"FIRST CVSS licence","name":"CVSS (FIRST)"}],"ssvc":{"automatable":"no","exploitation":"poc","technical_impact":"partial"},"state":"PUBLISHED","updated":"2025-04-22","vendors":["icsharpcode"]},"summary":"An attacker can create files outside the intended directory if the destination path lacks a trailing slash, potentially overwriting or creating unintended files.","url":"https://insights.sbomify.com/CVE-2021-32841/"}