{"answers":{"affected":"2 open source packages ship an affected version, including @fastify/swagger-ui. It affects 1 product.","exploited":"It is not confirmed as exploited in the wild, but public exploit code for CVE-2024-22207 exists.","fix":"Upgrade @fastify/swagger-ui to 2.1.0 or later.","what":"CVE-2024-22207 is a medium-severity vulnerability in fastify-swagger-ui, published on 15 Jan 2024. An attacker can exploit it over the internet without logging in, with no action from the victim."},"fix_prompt":"Check this codebase for CVE-2024-22207 and fix it if it is affected.\n\nWhat it is: CVE-2024-22207 is a medium-severity vulnerability in fastify-swagger-ui, published on 15 Jan 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.\nExploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2024-22207 exists.\n\nAffected packages and fixed versions:\n- @fastify/swagger-ui (npm): affected from 2.0.0; fixed in 2.1.0\n- @fastify/swagger-ui (npm): affected from 2.0.0; fixed in 2.1.0\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-2024-22207/ (Markdown: https://insights.sbomify.com/CVE-2024-22207/index.md)","id":"CVE-2024-22207","markdown":"https://insights.sbomify.com/CVE-2024-22207/index.md","name":"CVE-2024-22207","record":{"aliases":["GHSA-62jr-84gf-wmg4"],"analysis":{"component_type":"library","fix_type":"upgrade","impacts":["data_read"],"network_reachable":"yes","non_default_config":false,"product_category":"Fastify Swagger UI plugin","requires_auth":"none","summary":"Default configuration exposes all module files via HTTP routes, allowing attackers to read sensitive source code or configuration files.","user_interaction":"not_required","vuln_class":"information_disclosure"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"GitHub_M","cpe":[{"product":"swagger_ui","vendor":"smartbear"}],"cvss":{"score":5.3,"severity":"medium","source":"cna","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N","version":"3.1"},"cwes":[{"id":"CWE-1188","name":"Initialization of a Resource with an Insecure Default"}],"description":"fastify-swagger-ui is a Fastify plugin for serving Swagger UI.  Prior to 2.1.0, the default configuration of `@fastify/swagger-ui` without `baseDir` set will lead to all files in the module's directory being exposed via http routes served by the module.  The vulnerability is fixed in v2.1.0. Setting the `baseDir` option can also work around this vulnerability.","ecosystems":["npm"],"exploits":{"exploitdb":0,"first_seen":null,"github_poc":0,"max_poc_stars":null,"metasploit":0,"nuclei":1,"refs":[{"date":null,"kind":"nuclei","ref":"http/cves/2024/CVE-2024-22207.yaml","stars":null,"title":"Fastify Swagger-UI - Information Disclosure"}],"tier":"weaponised"},"has_fix":true,"headline":"Default swagger-ui configuration exposes all files in the module","id":"CVE-2024-22207","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"npm","product":null,"products":[],"type":"information_disclosure","year":"2024"},"n_packages":2,"n_references":3,"next":{"headline":"phpMyFAQ sharing FAQ functionality can easily be abused for phishing purposes","id":"CVE-2024-22208"},"packages":[{"ecosystem":"npm","fixed":["2.1.0"],"introduced":["2.0.0"],"last_affected":[],"package":"@fastify/swagger-ui","purl":null,"source":"GHSA-62jr-84gf-wmg4"},{"ecosystem":"npm","fixed":["2.1.0"],"introduced":["2.0.0"],"last_affected":[],"package":"@fastify/swagger-ui","purl":"pkg:npm/%40fastify/swagger-ui","source":"GHSA-62jr-84gf-wmg4"}],"prev":{"headline":"@clerk/nextjs auth() and getAuth() methods vulnerable to insecure direct object reference (IDOR)","id":"CVE-2024-22206"},"products":["fastify-swagger-ui"],"published":"2024-01-15","related":[{"cvss_score":4.3,"headline":"Spoofing attack in swagger-ui","id":"CVE-2018-25031","kev_date_added":null,"published":"2022-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)"},{"class":"attribution","licence":"MIT","name":"Nuclei templates"}],"ssvc":{"automatable":"no","exploitation":"none","technical_impact":"partial"},"state":"PUBLISHED","updated":"2025-06-17","vendors":["fastify"]},"summary":"Default configuration exposes all module files via HTTP routes, allowing attackers to read sensitive source code or configuration files.","url":"https://insights.sbomify.com/CVE-2024-22207/"}