8.2high
XSS in mdBook's search page
- Severity
- 8.2high CVSS:3.1 by GitHub_M
- Exploit likelihood
- 1.27% (higher than 70% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-gx5w-rrhp-f436RUSTSEC-2021-0001
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.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| rust-lang mdBook | < 0.4.5, from 0.1.4 before 0.4.5 | CVE List, NVD |
| mdBook (crates.io) | from 0.1.4 before 0.4.5, from 0.1.4-0 before 0.4.5 | GitHub Advisory Database, RustSec Advisory Database |
All scores
| GitHub_M | 8.2high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:H/A:N |
| GitHub | 8.2high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:H/A:N |
| RustSec Advisory Database | 6.1medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N |
| NVD | 6.1medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N |
| NVD | 4.3medium CVSS:2.0 | AV:N/AC:M/Au:N/C:N/I:P/A:N |
Classification
What each source says
CVE List
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.
GitHub Advisory Database
This is a cross-post of the official security advisory. The official post contains a signed version with our PGP key, as well.
The 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.
The CVE for this vulnerability is CVE-2020-26297.
Overview
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.
Mitigations
Owners 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:
cargo install mdbook --version 0.4.5 --force
Acknowledgements
Thanks to Kamil Vavra for responsibly disclosing the vulnerability to us according to our security policy.
Timeline of events
All times are listed in UTC.
- 2020-12-30 20:14 - The issue is reported to the Rust Security Response WG
- 2020-12-30 20:32 - The issue is acknowledged and the investigation began
- 2020-12-30 21:21 - Found the cause of the vulnerability and prepared the patch
- 2021-01-04 15:00 - Patched version released and vulnerability disclosed
RustSec Advisory Database
This is a cross-post of the official security advisory. The official post contains a signed version with our PGP key, as well.
The 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.
The CVE for this vulnerability is CVE-2020-26297.
Overview
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.
Mitigations
Owners 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:
cargo install mdbook --version 0.4.5 --force
Acknowledgements
Thanks to Kamil Vavra for responsibly disclosing the vulnerability to us according to our security policy.
Timeline of events
All times are listed in UTC.
- 2020-12-30 20:14 - The issue is reported to the Rust Security Response WG
- 2020-12-30 20:32 - The issue is acknowledged and the investigation began
- 2020-12-30 21:21 - Found the cause of the vulnerability and prepared the patch
- 2021-01-04 15:00 - Patched version released and vulnerability disclosed
NVD (es)
mdBook es una utilidad para crear libros en línea modernos a partir de archivos Markdown y es escrito en Rust. 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. 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. mdBook versión 0.4.5 corrige la vulnerabilidad al escapar correctamente de la consulta de búsqueda. 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.
References
| https://github.com/rust-lang/mdBook/security/advisories/GHSA-gx5w-rrhp-f436 | mitigation, third-party-advisory, web | |
| https://groups.google.com/g/rustlang-security-announcements/c/3-sO6of29O0 | mailing-list, third-party-advisory, web | |
| https://crates.io/crates/mdbook | package, product, third-party-advisory | |
| https://github.com/rust-lang/mdBook/blob/master/CHANGELOG.md#mdbook-045 | release-notes, third-party-advisory, web | |
| https://github.com/rust-lang/mdBook/commit/32abeef088e98327ca0dfccdad92e84afa9d2e9b | patch, third-party-advisory, web | |
| https://nvd.nist.gov/vuln/detail/CVE-2020-26297 | advisory | |
| https://github.com/rust-lang/mdBook | package | |
| https://rustsec.org/advisories/RUSTSEC-2021-0001.html | advisory, web | |
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2020-26297 changed 2024-08-04 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-gx5w-rrhp-f436 changed 2026-09-10 | CC-BY-4.0 |
| RustSec Advisory Database | RUSTSEC-2021-0001 changed 2023-11-08 | CC0-1.0 |
| NVD | CVE-2020-26297 changed 2026-06-17 | Public domain |