CVE-2020-26297
JSON

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 packageVersionsReported by
rust-lang mdBook< 0.4.5, from 0.1.4 before 0.4.5CVE List, NVD
mdBook (crates.io)from 0.1.4 before 0.4.5, from 0.1.4-0 before 0.4.5GitHub Advisory Database, RustSec Advisory Database

All scores

GitHub_M8.2high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:H/A:N
GitHub8.2high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:H/A:N
RustSec Advisory Database6.1medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
NVD6.1medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
NVD4.3medium CVSS:2.0AV: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.&#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.

References

Sources

SourceRecordLicence
CVE ListCVE-2020-26297 changed 2024-08-04CVE Terms of Use
GitHub Advisory DatabaseGHSA-gx5w-rrhp-f436 changed 2026-09-10CC-BY-4.0
RustSec Advisory DatabaseRUSTSEC-2021-0001 changed 2023-11-08CC0-1.0
NVDCVE-2020-26297 changed 2026-06-17Public domain