CVE-2024-38526: Pdoc Pdoc Embeds Link To Malicious Vulnerability

HIGH
Advisory Identifier: GHSA-5vgj-ggm4-fg62
CVSS 7.2
Published
Advisory Summary

CVE-2024-38526 is a HIGH (CVSS 7.2) pdoc embeds link to malicious vulnerability (General Security Weakness) affecting Pdoc libraries in the PyPI ecosystem. The issue involves pdoc embeds link to malicious cdn if math mode is enabled. Remediation is available by upgrading affected packages to version 14.5.1.

CVE-2024-38526 at a Glance

CVE Identifier CVE-2024-38526
GHSA Identifier GHSA-5vgj-ggm4-fg62
Severity HIGH
CVSS v3.1 Base Score 7.2
CWE Classification General Security Weakness
Affected Product Pdoc
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 7.2

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:N/A:L).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Changed (S:C)
Confidentiality Low (C:L)
Integrity None (I:N)
Availability Low (A:L)

How to Fix CVE-2024-38526

To remediate this vulnerability, upgrade all affected Pdoc dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

pdoc fixed: 14.5.1
pip install pdoc>=14.5.1
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

pip show pdoc

How to Check if You Are Affected

To determine whether your Python environment is affected by CVE-2024-38526, inspect your installed packages using pip:

pip show pdoc

Analyze the terminal output to locate any version of Pdoc in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 14.5.1), your application is affected.

Note: The pip show pdoc command checks currently installed packages in your active Python environment.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under General Security Weakness. In Pdoc, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Impact Documentation generated with `pdoc --math` linked to JavaScript files from polyfill.io. The polyfill.io CDN has been sold and now serves malicious code. Users who produce documentation with math mode should update immediately. All other users are unaffected. ### Patches This issue has been fixed in pdoc 14.5.1. ### References https://github.com/mitmproxy/pdoc/pull/703 https://sansec.io/research/polyfill-supply-chain-attack ### Timeline - **[2024-06-25]** https://sansec.io/research/polyfill-supply-chain-attack is published. - **[2024-06-25 20:54 UTC]** Issue reported to the pdoc project by @adhintz. - **[2024-06-25 21:33 UTC]** Patched version released. - **[2024-06-25 21:37 UTC]** Security advisory published. - **[2024-06-25 23:49 UTC]** CVE-2024-38526 assigned by GitHub.

CVE-2024-38526 Affected Pdoc Versions

1 component(s)
Fixed Versions:
14.5.1
Product / Package Ecosystem Affected Versions Fixed Version
pdoc
PyPI
< 14.5.1
14.5.1

References

Frequently Asked Questions

What is CVE-2024-38526?
CVE-2024-38526 is a security vulnerability in Pdoc involving pdoc embeds link to malicious CDN if math mode is enabled under General Security Weakness.
Which Pdoc versions are affected?
Affected versions include releases prior to 14.5.1 across affected packages: pdoc.
What version fixes CVE-2024-38526?
Upgrading to 14.5.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is pdoc affected?
Yes, pdoc is affected in releases prior to 14.5.1. Upgrade your dependency to 14.5.1 or later.
What is the CVSS score of CVE-2024-38526?
CVE-2024-38526 has a CVSS v3.1 base score of 7.2 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:N/A:L.
What CWE is associated with CVE-2024-38526?
CVE-2024-38526 is classified under General Security Weakness.
How can I check PyPI dependencies for CVE-2024-38526?
Run the dependency tree command: 'pip show pdoc'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-5vgj-ggm4-fg62",
  "modified" : "2024-07-26T21:36:47Z",
  "published" : "2024-06-25T22:23:30Z",
  "aliases" : [ "CVE-2024-38526" ],
  "summary" : "pdoc embeds link to malicious CDN if math mode is enabled",
  "details" : "### Impact\n\nDocumentation generated with `pdoc --math` linked to JavaScript files from polyfill.io.\nThe polyfill.io CDN has been sold and now serves malicious code.\n\nUsers who produce documentation with math mode should update immediately. All other users are unaffected.\n\n### Patches\n\nThis issue has been fixed in pdoc 14.5.1.\n\n### References\n\nhttps://github.com/mitmproxy/pdoc/pull/703\nhttps://sansec.io/research/polyfill-supply-chain-attack\n\n### Timeline\n\n- **[2024-06-25]** https://sansec.io/research/polyfill-supply-chain-attack is published.\n- **[2024-06-25 20:54 UTC]** Issue reported to the pdoc project by @adhintz.\n- **[2024-06-25 21:33 UTC]** Patched version released.\n- **[2024-06-25 21:37 UTC]** Security advisory published.\n- **[2024-06-25 23:49 UTC]** CVE-2024-38526 assigned by GitHub.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:N/A:L"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "pdoc"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "14.5.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/mitmproxy/pdoc/security/advisories/GHSA-5vgj-ggm4-fg62"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-38526"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/mitmproxy/pdoc/pull/703"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/mitmproxy/pdoc/commit/726b8f2e365fe8afeb3604a7c73d19b460395d58"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/mitmproxy/pdoc"
  }, {
    "type" : "WEB",
    "url" : "https://sansec.io/research/polyfill-supply-chain-attack"
  }, {
    "type" : "WEB",
    "url" : "https://www.vicarius.io/vsociety/posts/polyfillio-in-pdoc-cve-2024-38526"
  } ],
  "database_specific" : {
    "cwe_ids" : [ ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-06-25T22:23:30Z",
    "nvd_published_at" : "2024-06-26T00:15:10Z"
  }
}