Your RSA-2048 keys break in 2030. Find every one of them before attackers do.
🐍
🐍 PyPI
Not in CISA KEV
HIGH severity

CVE-2021-40978 — mkdocs

HIGHFix: mkdocs/mkdocs#2604

CVE-2021-40978 is a high-severity (CVSS 7.5) Path Traversal vulnerability in mkdocs. 1 public exploit reference exists, so weaponization risk is real. A fix is available for mkdocs — see the affected versions and patch details below.

Directory traversal in mkdocs

Also known asGHSA-qh9q-34h6-hcv9PYSEC-2021-878
Published
Updated
Affected
1 pkg
Patched
1 / 1
Exploits
1 known
Exploitation data as of Oct 9, 2026 · OSV.dev, NVD, FIRST.org (EPSS)

Exploitation Status

Proof-of-concept exploit code exists

  • CISA’s SSVC triage found public proof-of-concept exploit code for this CVE, though no confirmed active exploitation.

Exploitation and automatability from CISA’s SSVC triage for CVE-2021-40978.

EPSS Exploitation Probability

via FIRST.org ↗
15.1%probability of exploitation in next 30 days
Moderate Risk0.00%
Lower risk than most CVEs97th percentile — riskier than 97% of all scored CVEsHighest risk
0.00%33.3%66.7%100.0%84.8%15.1%Apr 26Aug 26Oct 26

Probability of exploitation in the next 30 days, from FIRST.org EPSS.

How urgent is this, really

CVE-2021-40978 by exploitation likelihood (EPSS) against impact (CVSS). Outside the shaded patch-first corner.

Where this sits among everything scored

Of 385,738 CVEs with a current EPSS score, this one falls in the 10–50% band (highlighted). Counts from FIRST.org, log-scaled.

Real-World Exposure

1 pkg affected
🐍mkdocs

Real-time download stats are indexed for npm and PyPI packages. This vulnerability affects PyPI packages — download data is not available via public APIs for these ecosystems.

Description

The mkdocs 1.2.2 built-in dev-server allows directory traversal using the port 8000, enabling remote exploitation to obtain :sensitive information. NOTE: the vendor has disputed this as described in https://github.com/mkdocs/mkdocs/issues/2601.] and https://github.com/nisdn/CVE-2021-40978/issues/1

Affected Packages

1 total 1 fixed
EcosystemPackageVulnerable rangeFix
🐍PyPImkdocs≥ 1.2.2&&< 1.2.31.2.3pip install --upgrade 'mkdocs==1.2.3'

Affected Products

1 product · 1 configurations
Application
mkdocsmkdocs
1 version
1.2.2
Exploits & PoCs
1

Research use only. For defensive security, authorized penetration testing, and academic research only. Never execute exploit code against systems without explicit written authorization.

Detection & mitigation playbook

Open-source dependency
  1. Detect

    Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for mkdocs, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.

  2. Fix

    Update mkdocs to 1.2.3 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2021-40978 is resolved across your whole dependency graph.

  3. Workarounds

    Resolve every user-supplied path to its canonical form and reject anything that escapes the intended directory, and run the component under an account that has no read or write access outside the directory it legitimately serves.

How to detect CVE-2021-40978

A community-maintained Nuclei template exists for this CVE. You can scan for it directly:

nuclei -id cve-2021-40978 -u https://target
Template
MKdocs 1.2.2 - Directory Traversal
Severity
high
Impact
An attacker can read or modify sensitive files on the server, potentially leading to unauthorized access, data leakage, or system compromise.
Remediation
Upgrade MKdocs to version 1.2.3 or later to fix the directory traversal vulnerability.

Template by ProjectDiscovery nuclei-templates (pikpikcu), MIT licensed. View the full template. Scan only systems you are authorised to test.

Frequently Asked Questions

The mkdocs 1.2.2 built-in dev-server allows directory traversal using the port 8000, enabling remote exploitation to obtain :sensitive information. NOTE: the vendor has disputed this as described in https://github.com/mkdocs/mkdocs/issues/2601.] and https://github.com/nisdn/CVE-2021-40978/issues/1
O3 Security · Impact-Aware SCA

Is CVE-2021-40978 in your dependencies?

Find it across PyPI, including transitive dependencies.

CVE-2021-40978: mkdocs Path Traversal — Fixed in 1.2.3