Skip to content
Heist/ feed
Back to feed
Medium

Security advisory

Type: advisorySources: OSVCVE: CVE-2020-26297

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.

Products
Not specified
Affected versions
Not specified
Fixed versions
Not specified
CVEs
CVE-2020-26297
Confirmed fixed CVEs
Not specified
Updated in this feed
31 Oct 2026, 11:09 UTC · Revision 1

Source evidence

CVE-2020-26297

core-osv · Original source

Published 4 Jan 2021, 19:15 UTC

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.

osv:CVE-2020-26297
Complete source record
{
  "id": "86d78b8d0e02758068ca071a98e3cebd882b42e9d022d04fb9a3fb5810015288",
  "url": "https://osv.dev/vulnerability/CVE-2020-26297",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "CVE-2020-26297",
    "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.",
    "evidence": "osv:CVE-2020-26297",
    "products": [],
    "severity": "medium",
    "structured": {
      "id": "CVE-2020-26297",
      "aliases": [
        "CVE-2020-26297",
        "GHSA-gx5w-rrhp-f436",
        "RUSTSEC-2021-0001"
      ],
      "metrics": [
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://github.com/rust-lang/mdbook",
              "type": "GIT",
              "events": [
                {
                  "introduced": "c8bbfd4bc1473a4f680c519ffbcd1b8476432f17"
                },
                {
                  "fixed": "f66df0932401e762bdfd4906e982af7b00af3bd9"
                },
                {
                  "fixed": "32abeef088e98327ca0dfccdad92e84afa9d2e9b"
                }
              ],
              "database_specific": {
                "extracted_events": [
                  {
                    "cpe": "cpe:2.3:a:rust-lang:mdbook:*:*:*:*:*:rust:*:*",
                    "range": [
                      {
                        "introduced": "0.1.4"
                      },
                      {
                        "fixed": "0.4.5"
                      }
                    ],
                    "source": "CPE_RANGE"
                  },
                  {
                    "range": [
                      {
                        "fixed": "32abeef088e98327ca0dfccdad92e84afa9d2e9b"
                      }
                    ],
                    "source": "REFERENCES_COMMIT"
                  }
                ]
              }
            }
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2020-26297.json"
          }
        }
      ],
      "modified": "2026-10-20T10:52:58.202053390Z",
      "provider": "osv",
      "references": [
        "https://crates.io/crates/mdbook",
        "https://github.com/rust-lang/mdBook/blob/master/CHANGELOG.md#mdbook-045",
        "https://github.com/rust-lang/mdBook/security/advisories/GHSA-gx5w-rrhp-f436",
        "https://groups.google.com/g/rustlang-security-announcements/c/3-sO6of29O0",
        "https://github.com/rust-lang/mdBook/commit/32abeef088e98327ca0dfccdad92e84afa9d2e9b"
      ],
      "provider_metadata": {}
    },
    "related_cves": [
      {
        "value": "CVE-2020-26297",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 384104,
  "published_at": "2021-01-04T19:15:15.173+00:00"
}