{"answers":{"affected":"3 open source packages ship an affected version, including mdBook and mdbook. It affects 1 product.","exploited":"There is no known exploitation of CVE-2020-26297 in the wild and no public exploit code.","fix":"Upgrade mdBook to 0.4.5 or later.","what":"CVE-2020-26297 is a high-severity vulnerability in rust-lang mdBook, published on 4 Jan 2021."},"fix_prompt":"Check this codebase for CVE-2020-26297 and fix it if it is affected.\n\nWhat it is: CVE-2020-26297 is a high-severity vulnerability in rust-lang mdBook, published on 4 Jan 2021. \nExploitation: There is no known exploitation of CVE-2020-26297 in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- mdBook (crates.io): affected from 0.1.4; fixed in 0.4.5\n- mdBook (crates.io): affected from 0.1.4; fixed in 0.4.5\n- mdbook (crates.io): affected from 0.1.4-0; fixed in 0.4.5\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-2020-26297/ (Markdown: https://insights.sbomify.com/CVE-2020-26297/index.md)","id":"CVE-2020-26297","markdown":"https://insights.sbomify.com/CVE-2020-26297/index.md","name":"CVE-2020-26297","record":{"aliases":["GHSA-gx5w-rrhp-f436","RUSTSEC-2021-0001"],"analysis":null,"analysis_generated_by":null,"assigner":"GitHub_M","cpe":[{"product":"mdbook","vendor":"rust-lang"}],"cvss":{"score":8.2,"severity":"high","source":"cna","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:H/A:N","version":"3.1"},"cwes":[{"id":"CWE-79","name":"Improper Neutralization of Input During Web Page Generation"}],"description":"mdBook is a utility to create modern online books from Markdown files and is written in Rust. In mdBook before version 0.4.5, there is a vulnerability affecting the search feature of mdBook, which could allow an attacker to execute arbitrary JavaScript code on the page. The search feature of mdBook (introduced in version 0.1.4) was affected by a cross site scripting vulnerability that allowed an attacker to execute arbitrary JavaScript code on an user's browser by tricking the user into typing a malicious search query, or tricking the user into clicking a link to the search page with the malicious search query prefilled. mdBook 0.4.5 fixes the vulnerability by properly escaping the search query. Owners of websites built with mdBook have to upgrade to mdBook 0.4.5 or greater and rebuild their website contents with it.","ecosystems":["crates.io"],"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":"XSS in mdBook's search page","id":"CVE-2020-26297","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"crates.io","product":null,"products":[],"type":null,"year":"2020"},"n_packages":3,"n_references":5,"next":{"headline":"Injection in Redcarpet","id":"CVE-2020-26298"},"packages":[{"ecosystem":"crates.io","fixed":["0.4.5"],"introduced":["0.1.4"],"last_affected":[],"package":"mdBook","purl":null,"source":"GHSA-gx5w-rrhp-f436"},{"ecosystem":"crates.io","fixed":["0.4.5"],"introduced":["0.1.4"],"last_affected":[],"package":"mdBook","purl":"pkg:cargo/mdBook","source":"GHSA-gx5w-rrhp-f436"},{"ecosystem":"crates.io","fixed":["0.4.5"],"introduced":["0.1.4-0"],"last_affected":[],"package":"mdbook","purl":"pkg:cargo/mdbook","source":"RUSTSEC-2021-0001"}],"prev":{"headline":"XSS in Vega","id":"CVE-2020-26296"},"products":["mdBook"],"published":"2021-01-04","related":[],"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":"open","licence":"CC0 1.0","name":"RustSec","prefix":"RUSTSEC"},{"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-04","vendors":["rust-lang"]},"summary":null,"url":"https://insights.sbomify.com/CVE-2020-26297/"}