{"id":"CVE-2020-26297","aliases":["CVE-2020-26297","GHSA-gx5w-rrhp-f436","RUSTSEC-2021-0001"],"related":[],"kind":"vulnerability","state":"published","title":"XSS in mdBook's search page","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"en","text":"> This is a cross-post of [the official security advisory][ml]. The official post contains a signed version with our PGP key, as well.\n\n[ml]: https://groups.google.com/g/rustlang-security-announcements/c/3-sO6of29O0\n\nThe Rust Security Response Working Group was recently notified of a security issue affecting the search feature of mdBook, which could allow an attacker to execute arbitrary JavaScript code on the page.\n\nThe CVE for this vulnerability is [CVE-2020-26297](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-26297).\n\n## Overview\n\nThe 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.\n\nmdBook 0.4.5 fixes the vulnerability by properly escaping the search query.\n\n## Mitigations\n\nOwners of websites built with mdBook have to upgrade to mdBook 0.4.5 or greater and rebuild their website contents with it. It's possible to install mdBook 0.4.5 on the local system with:\n\n```\ncargo install mdbook --version 0.4.5 --force\n```\n\n## Acknowledgements\n\nThanks to Kamil Vavra for responsibly disclosing the vulnerability to us according to [our security policy](https://www.rust-lang.org/policies/security).\n\n## Timeline of events\n\nAll times are listed in UTC.\n\n- 2020-12-30 20:14 - The issue is reported to the Rust Security Response WG\n- 2020-12-30 20:32 - The issue is acknowledged and the investigation began\n- 2020-12-30 21:21 - Found the cause of the vulnerability and prepared the patch\n- 2021-01-04 15:00 - Patched version released and vulnerability disclosed","format":"markdown","source":"ghsa"},{"lang":"en","text":"> This is a cross-post of [the official security advisory][ml]. The official post\n> contains a signed version with our PGP key, as well.\n\n[ml]: https://groups.google.com/g/rustlang-security-announcements/c/3-sO6of29O0\n\nThe Rust Security Response Working Group was recently notified of a security\nissue affecting the search feature of mdBook, which could allow an attacker to\nexecute arbitrary JavaScript code on the page.\n\nThe CVE for this vulnerability is [CVE-2020-26297][1].\n\n## Overview\n\nThe search feature of mdBook (introduced in version 0.1.4) was affected by a\ncross site scripting vulnerability that allowed an attacker to execute\narbitrary JavaScript code on an user's browser by tricking the user into typing\na malicious search query, or tricking the user into clicking a link to the\nsearch page with the malicious search query prefilled.\n\nmdBook 0.4.5 fixes the vulnerability by properly escaping the search query.\n\n## Mitigations\n\nOwners of websites built with mdBook have to upgrade to mdBook 0.4.5 or greater\nand rebuild their website contents with it. It's possible to install mdBook\n0.4.5 on the local system with:\n\n```\ncargo install mdbook --version 0.4.5 --force\n```\n\n## Acknowledgements\n\nThanks to Kamil Vavra for responsibly disclosing the vulnerability to us\naccording to [our security policy][2].\n\n## Timeline of events\n\nAll times are listed in UTC.\n\n* 2020-12-30 20:14 - The issue is reported to the Rust Security Response WG\n* 2020-12-30 20:32 - The issue is acknowledged and the investigation began\n* 2020-12-30 21:21 - Found the cause of the vulnerability and prepared the patch\n* 2021-01-04 15:00 - Patched version released and vulnerability disclosed\n\n[1]: https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-26297\n[2]: https://www.rust-lang.org/policies/security","format":"markdown","source":"rustsec"},{"lang":"es","text":"mdBook es una utilidad para crear libros en línea modernos a partir de archivos Markdown y es escrito en Rust.&#xa0;En mdBook versiones anteriores a 0.4.5, se presenta una vulnerabilidad que afecta la funcionalidad search de mdBook, que podría permitir a un atacante ejecutar código JavaScript arbitrario en la página.&#xa0;La funcionalidad search de mdBook (introducida en la versión 0.1.4) estaba afectada por una vulnerabilidad de tipo cross site scripting que permitía a un atacante ejecutar código JavaScript arbitrario en el navegador de un usuario al engañar al usuario para que escriba una consulta de búsqueda maliciosa o engañe al usuario para que haciendo clic en un enlace para la página de búsqueda con la consulta de búsqueda maliciosa precargada.&#xa0;mdBook versión 0.4.5 corrige la vulnerabilidad al escapar correctamente de la consulta de búsqueda.&#xa0;Los propietarios de sitios web diseñados con mdBook deben actualizar a mdBook versiones 0.4.5 o superiores y reconstruir el contenido de su sitio web con él.","source":"nvd"}],"published":"2021-01-04T12:00:00.000Z","modified":"2026-09-10T03:49:07.989Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:H/A:N","score":8.2,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:H/A:N","score":8.2,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:H/A:N","score":8.2,"rating":"HIGH"},{"scorer":"RustSec Advisory Database","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","score":6.1,"rating":"MEDIUM"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","score":6.1,"rating":"MEDIUM"},{"scorer":"NVD","scheme":"CVSS:2.0","vector":"AV:N/AC:M/Au:N/C:N/I:P/A:N","score":4.3,"rating":"MEDIUM"}],"cwes":["CWE-79"],"affected":[{"ranges":[{"version":"< 0.4.5","status":"affected"}],"vendor":"rust-lang","product":"mdBook","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0.1.4","status":"affected","fixed":"0.4.5"}],"ecosystem":"crates.io","package":"mdBook","purl":"pkg:cargo/mdBook","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0.1.4-0","status":"affected","fixed":"0.4.5"}],"ecosystem":"crates.io","package":"mdbook","purl":"pkg:cargo/mdbook","source":"rustsec"},{"ranges":[{"status":"affected","introduced":"0.1.4","fixed":"0.4.5"}],"vendor":"rust-lang","product":"mdbook","cpe":"cpe:2.3:a:rust-lang:mdbook:*:*:*:*:*:rust:*:*","source":"nvd"}],"references":[{"url":"https://github.com/rust-lang/mdBook/security/advisories/GHSA-gx5w-rrhp-f436","tags":["mitigation","third-party-advisory","web","x-refsource-confirm","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://groups.google.com/g/rustlang-security-announcements/c/3-sO6of29O0","tags":["mailing-list","third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","rustsec","nvd"]},{"url":"https://crates.io/crates/mdbook","tags":["package","product","third-party-advisory","x-refsource-misc","x-transferred"],"sources":["cvelist","rustsec","nvd"]},{"url":"https://github.com/rust-lang/mdBook/blob/master/CHANGELOG.md#mdbook-045","tags":["release-notes","third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/rust-lang/mdBook/commit/32abeef088e98327ca0dfccdad92e84afa9d2e9b","tags":["patch","third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2020-26297","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/rust-lang/mdBook","tags":["package"],"sources":["ghsa"]},{"url":"https://rustsec.org/advisories/RUSTSEC-2021-0001.html","tags":["advisory","web"],"sources":["ghsa","rustsec"]}],"credits":[],"assigner":"GitHub_M","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2020-26297","url":"https://www.cve.org/CVERecord?id=CVE-2020-26297","licence":"CVE Terms of Use","modified":"2024-08-04T15:56:04.096Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-gx5w-rrhp-f436","url":"https://github.com/advisories/GHSA-gx5w-rrhp-f436","licence":"CC-BY-4.0","modified":"2026-09-10T03:49:07.989Z"},{"source":"rustsec","name":"RustSec Advisory Database","id":"RUSTSEC-2021-0001","url":"https://rustsec.org/advisories/RUSTSEC-2021-0001.html","licence":"CC0-1.0","modified":"2023-11-08T04:03:18.452Z"},{"source":"nvd","name":"NVD","id":"CVE-2020-26297","url":"https://nvd.nist.gov/vuln/detail/CVE-2020-26297","licence":"Public domain","modified":"2026-06-17T03:08:01.467Z"}],"updatedAt":"2026-11-25T22:57:56.856Z","epss":{"score":0.0127,"percentile":0.70634,"date":"2026-12-01T12:00:22.000Z"}}