# CVE-2024-38526: pdoc embeds link to malicious CDN if math mode is enabled

> Attackers can execute malicious code in browsers viewing documentation generated with math mode enabled due to a compromised CDN link.

- **Severity:** Not scored
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 25 Jun 2024
- **Updated:** 13 Feb 2025
- **Also known as:** GHSA-5vgj-ggm4-fg62, PYSEC-2026-1764, SUSE-SU-2025:02037-1, openSUSE-SU-2024:14187-1

## What is CVE-2024-38526?

CVE-2024-38526 is a vulnerability in mitmproxy pdoc, published on 25 Jun 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

pdoc provides API Documentation for Python Projects. Documentation generated with `pdoc --math` linked to JavaScript files from polyfill.io. The polyfill.io CDN has been sold and now serves malicious code. This issue has been fixed in pdoc 14.5.1.

Weakness: CWE-1395 (Dependency on Vulnerable Third-Party Component)

## Which versions are affected by CVE-2024-38526?

3 open source packages ship an affected version, including pdoc.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `pdoc` | PyPI | All versions | 14.5.1 |
| `pdoc` | PyPI | All versions | 14.5.1 |
| `pdoc` | PyPI | All versions | 14.5.1 |
| `ghc-pandoc` | SUSE:Linux Enterprise Module for Package Hub 15 SP6 | All versions | 3.1.11.1-150500.11.6.1 |
| `ghc-pandoc` | SUSE:Linux Enterprise Module for Package Hub 15 SP7 | All versions | 3.1.11.1-150500.11.6.1 |
| `ghc-pandoc` | openSUSE:Leap 15.6 | All versions | 3.1.11.1-150500.11.6.1 |
| `netpbm` | openSUSE:Tumbleweed | All versions | 11.7.0-1.1 |

## How do I fix CVE-2024-38526?

Upgrade pdoc to 14.5.1 or later.

## Is CVE-2024-38526 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2024-38526 exists.

Public exploit code:

- A specialized vulnerability scanner designed to detect CVE-2024-38526, the Polyfill.io Supply Chain Attack, helping organizations identify and mitigate risks associated with compromised third-party dependencies.  (github_poc): https://github.com/padayali-JD/pollyscan
- CVE-2024-38526 -  Polyfill Scanner (github_poc): https://github.com/putget/CVE-2024-38526

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2024-38526 and fix it if it is affected.

What it is: CVE-2024-38526 is a vulnerability in mitmproxy pdoc, published on 25 Jun 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2024-38526 exists.

Affected packages and fixed versions:
- pdoc (PyPI): affected all versions; fixed in 14.5.1
- pdoc (PyPI): affected all versions; fixed in 14.5.1
- pdoc (PyPI): affected all versions; fixed in 14.5.1

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2024-38526/ (Markdown: https://insights.sbomify.com/CVE-2024-38526/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2024-38526
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2024-38526
- OSV: https://osv.dev/vulnerability/CVE-2024-38526

---
From sbomify Insights: https://insights.sbomify.com/CVE-2024-38526/
Summaries are generated and may contain mistakes; the official description above is the record.
