{"answers":{"affected":"2 open source packages ship an affected version, including io.swagger:swagger-codegen. It affects 1 product.","exploited":"There is no known exploitation of CVE-2021-21364 in the wild and no public exploit code.","fix":"Upgrade io.swagger:swagger-codegen to 2.4.19 or later.","what":"CVE-2021-21364 is a medium-severity vulnerability in swagger-api swagger-codegen, published on 11 Mar 2021. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link."},"fix_prompt":"Check this codebase for CVE-2021-21364 and fix it if it is affected.\n\nWhat it is: CVE-2021-21364 is a medium-severity vulnerability in swagger-api swagger-codegen, published on 11 Mar 2021. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.\nExploitation: There is no known exploitation of CVE-2021-21364 in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- io.swagger:swagger-codegen (Maven): affected all versions; fixed in 2.4.19\n- io.swagger:swagger-codegen (Maven): affected all versions; fixed in 2.4.19\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-21364/ (Markdown: https://insights.sbomify.com/CVE-2021-21364/index.md)","id":"CVE-2021-21364","markdown":"https://insights.sbomify.com/CVE-2021-21364/index.md","name":"CVE-2021-21364","record":{"aliases":["GHSA-hpv8-9rq5-hq7w"],"analysis":{"component_type":"developer_tool","fix_type":"upgrade","impacts":["data_read"],"network_reachable":"adjacent_or_local","non_default_config":false,"product_category":"Code generation tool","requires_auth":"low_privilege","summary":"Local attackers can read generated code files due to insecure default permissions in swagger-codegen, exposing sensitive information.","user_interaction":"required","vuln_class":"information_disclosure"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"GitHub_M","cpe":[{"product":"swagger-codegen","vendor":"smartbear"}],"cvss":{"score":5.3,"severity":"medium","source":"cna","vector":"CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:C/C:H/I:N/A:N","version":"3.1"},"cwes":[{"id":"CWE-732","name":"Incorrect Permission Assignment for Critical Resource"},{"id":"CWE-378","name":"Creation of Temporary File With Insecure Permissions"},{"id":"CWE-200","name":"Exposure of Sensitive Information to an Unauthorized Actor"}],"description":"swagger-codegen is an open-source project which contains a template-driven engine to generate documentation, API clients and server stubs in different languages by parsing your OpenAPI / Swagger definition. In swagger-codegen before version 2.4.19, on Unix-Like systems, the system temporary directory is shared between all local users. When files/directories are created, the default `umask` settings for the process are respected. As a result, by default, most processes/apis will create files/directories with the permissions `-rw-r--r--` and `drwxr-xr-x` respectively, unless an API that explicitly sets safe file permissions is used. Because this vulnerability impacts generated code, the generated code will remain vulnerable until fixed manually! This vulnerability is fixed in version 2.4.19. Note this is a distinct vulnerability from CVE-2021-21363.","ecosystems":["Maven"],"exploits":{"exploitdb":0,"first_seen":null,"github_poc":0,"max_poc_stars":null,"metasploit":0,"nuclei":0,"refs":[],"tier":"none_known"},"has_fix":true,"headline":"Generated Code Contains Local Information Disclosure Vulnerability","id":"CVE-2021-21364","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"Maven","product":null,"products":[],"type":"information_disclosure","year":"2021"},"n_packages":2,"n_references":2,"next":{"headline":"Cross-Site Scripting in Content Rendering","id":"CVE-2021-21365"},"packages":[{"ecosystem":"Maven","fixed":["2.4.19"],"introduced":["0"],"last_affected":[],"package":"io.swagger:swagger-codegen","purl":null,"source":"GHSA-hpv8-9rq5-hq7w"},{"ecosystem":"Maven","fixed":["2.4.19"],"introduced":["0"],"last_affected":[],"package":"io.swagger:swagger-codegen","purl":"pkg:maven/io.swagger/swagger-codegen","source":"GHSA-hpv8-9rq5-hq7w"}],"prev":{"headline":"Generator Web Application: Local Privilege Escalation Vulnerability via System Temp Directory","id":"CVE-2021-21363"},"products":["swagger-codegen"],"published":"2021-03-11","related":[{"cvss_score":5.3,"headline":"Generator Web Application: Local Privilege Escalation Vulnerability via System Temp Directory","id":"CVE-2021-21363","kev_date_added":null,"published":"2021-03-11"}],"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":null,"exploitation":null,"technical_impact":null},"state":"PUBLISHED","updated":"2024-08-03","vendors":["swagger-api"]},"summary":"Local attackers can read generated code files due to insecure default permissions in swagger-codegen, exposing sensitive information.","url":"https://insights.sbomify.com/CVE-2021-21364/"}