Vulnerabilities in pkg:pypi/markdownify

PACKAGE
Advisory Identifier: GHSA-7mpr-5m44-h73r
Advisory Summary

CVE-2025-46656 is a LOW (CVSS 2.9) markdownify allows large headline prefixes vulnerability (CWE-1284: Improper Validation of Specified Quantity in Input) affecting Markdownify libraries in the PyPI ecosystem. The issue involves markdownify allows large headline prefixes such as <h9999999>, which causes memory consumption. Remediation is available by upgrading affected packages to version 0.14.1.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:pypi/markdownify

1 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:pypi/markdownify. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-7mpr-5m44-h73r CVE-2025-46656 LOW markdownify allows large headline prefixes such as <h9999999>, which causes memory consumption

CVE-2025-46656 at a Glance

CVE Identifier CVE-2025-46656
GHSA Identifier GHSA-7mpr-5m44-h73r
Severity LOW
CVSS v3.1 Base Score 2.9
CWE Classification CWE-1284: Improper Validation of Specified Quantity in Input
Affected Product Markdownify
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 2.9

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

Attack Vector Local (AV:L)
Attack Complexity High (AC:H)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity None (I:N)
Availability Low (A:L)

How to Fix CVE-2025-46656

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

markdownify fixed: 0.14.1
pip install markdownify>=0.14.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 markdownify

How to Check if You Are Affected

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

pip show markdownify

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

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

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-1284: Improper Validation of Specified Quantity in Input, where the product receives input that is expected to specify a quantity (such as size or length), but it does not validate or incorrectly validates that the quantity has the required properties. In Markdownify, 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

python-markdownify (aka markdownify) before 0.14.1 allows large headline prefixes such as <h9999999> in addition to <h1> through <h6>. This causes memory consumption.

CVE-2025-46656 Affected Markdownify Versions

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

References

Frequently Asked Questions

What is CVE-2025-46656?
CVE-2025-46656 is a security vulnerability in Markdownify involving markdownify allows large headline prefixes such as <h9999999>, which causes memory consumption under CWE-1284: Improper Validation of Specified Quantity in Input.
Which Markdownify versions are affected?
Affected versions include releases prior to 0.14.1 across affected packages: markdownify.
What version fixes CVE-2025-46656?
Upgrading to 0.14.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is markdownify affected?
Yes, markdownify is affected in releases prior to 0.14.1. Upgrade your dependency to 0.14.1 or later.
What is the CVSS score of CVE-2025-46656?
CVE-2025-46656 has a CVSS v3.1 base score of 2.9 (LOW) with vector string CVSS:3.1/AV:L/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:L.
What CWE is associated with CVE-2025-46656?
CVE-2025-46656 is classified under CWE-1284: Improper Validation of Specified Quantity in Input (The product receives input that is expected to specify a quantity (such as size or length), but it does not validate or incorrectly validates that the quantity has the required properties.).
How can I check PyPI dependencies for CVE-2025-46656?
Run the dependency tree command: 'pip show markdownify'. 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-7mpr-5m44-h73r",
  "modified" : "2025-04-28T14:34:51Z",
  "published" : "2025-04-27T00:30:34Z",
  "aliases" : [ "CVE-2025-46656" ],
  "summary" : "markdownify allows large headline prefixes such as <h9999999>, which causes memory consumption",
  "details" : "python-markdownify (aka markdownify) before 0.14.1 allows large headline prefixes such as <h9999999> in addition to <h1> through <h6>. This causes memory consumption.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:L/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:L"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "markdownify"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.14.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-46656"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/matthewwithanm/python-markdownify/issues/143"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/matthewwithanm/python-markdownify/commit/959561879693bf4a576f99c6733b50b01186aa08"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/matthewwithanm/python-markdownify"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/matthewwithanm/python-markdownify/compare/0.14.0...0.14.1"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-1284" ],
    "severity" : "LOW",
    "github_reviewed" : true,
    "github_reviewed_at" : "2025-04-28T14:34:51Z",
    "nvd_published_at" : "2025-04-26T22:15:17Z"
  }
}