{"answers":{"affected":"4 open source packages ship an affected version, including org.webjars:swagger-ui and swagger-ui. It affects 1 product.","exploited":"It is not confirmed as exploited in the wild, but public exploit code for CVE-2018-25031 exists.","fix":"Upgrade org.webjars:swagger-ui to 4.1.3 or later.","what":"CVE-2018-25031 is a medium-severity server-side request forgery vulnerability in n/a, published on 11 Mar 2022. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link."},"fix_prompt":"Check this codebase for CVE-2018-25031 and fix it if it is affected.\n\nWhat it is: CVE-2018-25031 is a medium-severity server-side request forgery vulnerability in n/a, published on 11 Mar 2022. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.\nExploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2018-25031 exists.\n\nAffected packages and fixed versions:\n- org.webjars:swagger-ui (Maven): affected all versions; fixed in 4.1.3\n- org.webjars:swagger-ui (Maven): affected all versions; fixed in 4.1.3\n- swagger-ui (npm): affected all versions; fixed in 4.1.3\n- swagger-ui (npm): affected all versions; fixed in 4.1.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-2018-25031/ (Markdown: https://insights.sbomify.com/CVE-2018-25031/index.md)","id":"CVE-2018-25031","markdown":"https://insights.sbomify.com/CVE-2018-25031/index.md","name":"CVE-2018-25031","record":{"aliases":["GHSA-cr3q-pqgq-m8c2"],"analysis":{"component_type":"library","fix_type":"no_fix_stated","impacts":["data_read","security_bypass"],"network_reachable":"yes","non_default_config":false,"product_category":"Swagger UI library","requires_auth":"none","summary":"Remote attackers can force Swagger UI to load malicious OpenAPI definitions via crafted URLs, enabling spoofing and potential data exposure.","user_interaction":"required","vuln_class":"ssrf"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"mitre","cpe":[{"product":"swagger_ui","vendor":"smartbear"}],"cvss":{"score":4.3,"severity":"medium","source":"cisa-adp","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:N/A:N","version":"3.1"},"cwes":[{"id":"CWE-918","name":"Server-Side Request Forgery"},{"id":"CWE-922","name":"Insecure Storage of Sensitive Information"},{"id":"CWE-20","name":"Improper Input Validation"}],"description":"Swagger UI 4.1.2 and earlier could allow a remote attacker to conduct spoofing attacks. By persuading a victim to open a crafted URL, an attacker could exploit this vulnerability to display remote OpenAPI definitions. Note: This was originally claimed to be resolved in 4.1.3. However, third parties have indicated this is not resolved in 4.1.3 and even occurs in that version and possibly others.","ecosystems":["Maven","npm"],"exploits":{"exploitdb":0,"first_seen":"2022-05-26","github_poc":15,"max_poc_stars":3,"metasploit":0,"nuclei":0,"refs":[{"date":"2023-06-28T13:41:22Z","kind":"github_poc","ref":"https://github.com/mathis2001/CVE-2018-25031","stars":3,"title":"CVE-2018-25031 tests"},{"date":"2022-05-26T19:06:21Z","kind":"github_poc","ref":"https://github.com/afine-com/CVE-2018-25031","stars":2,"title":".json and .yaml files used to exploit CVE-2018-25031"},{"date":"2023-04-14T19:48:29Z","kind":"github_poc","ref":"https://github.com/rafaelcintralopes/SwaggerUI-CVE-2018-25031","stars":2,"title":"Exploit Swagger UI - User Interface (UI) Misrepresentation of Critical Information (CVE-2018-25031)"},{"date":"2023-11-16T00:29:31Z","kind":"github_poc","ref":"https://github.com/LUCASRENAA/CVE-2018-25031","stars":0,"title":null},{"date":"2023-12-13T18:42:20Z","kind":"github_poc","ref":"https://github.com/hev0x/CVE-2018-25031-PoC","stars":0,"title":"PoC of CVE-2018-25031"},{"date":"2024-02-22T10:41:45Z","kind":"github_poc","ref":"https://github.com/johnlaurance/CVE-2018-25031-test2","stars":0,"title":null},{"date":"2024-05-15T23:21:58Z","kind":"github_poc","ref":"https://github.com/geozin/POC-CVE-2018-25031","stars":0,"title":"A simple POC (CVE-2018-25031"},{"date":"2024-05-21T02:09:02Z","kind":"github_poc","ref":"https://github.com/h2oa/CVE-2018-25031","stars":0,"title":null}],"tier":"weaponised"},"has_fix":true,"headline":"Spoofing attack in swagger-ui","id":"CVE-2018-25031","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"Maven","product":null,"products":[],"type":"ssrf","year":"2018"},"n_packages":4,"n_references":4,"next":{"headline":"Nokogiri affected by zlib's Out-of-bounds Write vulnerability","id":"CVE-2018-25032"},"packages":[{"ecosystem":"Maven","fixed":["4.1.3"],"introduced":["0"],"last_affected":[],"package":"org.webjars:swagger-ui","purl":null,"source":"GHSA-cr3q-pqgq-m8c2"},{"ecosystem":"Maven","fixed":["4.1.3"],"introduced":["0"],"last_affected":[],"package":"org.webjars:swagger-ui","purl":"pkg:maven/org.webjars/swagger-ui","source":"GHSA-cr3q-pqgq-m8c2"},{"ecosystem":"npm","fixed":["4.1.3"],"introduced":["0"],"last_affected":[],"package":"swagger-ui","purl":null,"source":"GHSA-cr3q-pqgq-m8c2"},{"ecosystem":"npm","fixed":["4.1.3"],"introduced":["0"],"last_affected":[],"package":"swagger-ui","purl":"pkg:npm/swagger-ui","source":"GHSA-cr3q-pqgq-m8c2"}],"prev":{"headline":"Mirmay Secure Private Browser / File Manager Auto Lock improper authentication","id":"CVE-2018-25030"},"products":["n/a"],"published":"2022-03-11","related":[{"cvss_score":5.3,"headline":"Default swagger-ui configuration exposes all files in the module","id":"CVE-2024-22207","kev_date_added":null,"published":"2024-01-15"}],"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":"open","licence":"CC0","name":"PoC-in-GitHub"}],"ssvc":{"automatable":"no","exploitation":"poc","technical_impact":"partial"},"state":"PUBLISHED","updated":"2024-08-05","vendors":["n/a"]},"summary":"Remote attackers can force Swagger UI to load malicious OpenAPI definitions via crafted URLs, enabling spoofing and potential data exposure.","url":"https://insights.sbomify.com/CVE-2018-25031/"}