CVE-2023-26302: Markdown it py Denial of Service Vulnerability

HIGH
Advisory Identifier: GHSA-jrwr-5x3p-hvc3
CVSS 5.5
CWE-173
Published
Advisory Summary

CVE-2023-26302 is a HIGH (CVSS 5.5) denial of service vulnerability (CWE-173: Improper Handling of Alternate Encoding) affecting Markdown it py libraries in the PyPI ecosystem. The issue involves markdown-it-py denial of service vulnerability in the command line interface. Remediation is available by upgrading affected packages to version 2.2.0.

CVE-2023-26302 at a Glance

CVE Identifier CVE-2023-26302
GHSA Identifier GHSA-jrwr-5x3p-hvc3
Severity HIGH
CVSS v3.1 Base Score 5.5
CWE Classification CWE-173: Improper Handling of Alternate Encoding
Affected Product Markdown it py
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 5.5

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

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

How to Fix CVE-2023-26302

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

markdown-it-py fixed: 2.2.0
pip install markdown-it-py>=2.2.0
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 markdown-it-py

How to Check if You Are Affected

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

pip show markdown-it-py

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

Note: The pip show markdown-it-py command checks currently installed packages in your active Python environment.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-173: Improper Handling of Alternate Encoding, where the product does not properly handle when an input uses an alternate encoding that is valid for the control sphere to which the input is being sent. In Markdown it py, 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

Denial of service could be caused to the command line interface of markdown-it-py, before v2.2.0, if an attacker was allowed to use invalid UTF-8 characters as input.

CVE-2023-26302 Affected Markdown it py Versions

1 component(s)
Fixed Versions:
2.2.0
Product / Package Ecosystem Affected Versions Fixed Version
markdown-it-py
PyPI
< 2.2.0
2.2.0

References

Frequently Asked Questions

What is CVE-2023-26302?
CVE-2023-26302 is a security vulnerability in Markdown it py involving markdown-it-py Denial of Service vulnerability in the command line interface under CWE-173: Improper Handling of Alternate Encoding.
Which Markdown it py versions are affected?
Affected versions include releases prior to 2.2.0 across affected packages: markdown-it-py.
What version fixes CVE-2023-26302?
Upgrading to 2.2.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is markdown-it-py affected?
Yes, markdown-it-py is affected in releases prior to 2.2.0. Upgrade your dependency to 2.2.0 or later.
What is the CVSS score of CVE-2023-26302?
CVE-2023-26302 has a CVSS v3.1 base score of 5.5 (HIGH) with vector string CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H.
What CWE is associated with CVE-2023-26302?
CVE-2023-26302 is classified under CWE-173: Improper Handling of Alternate Encoding (The product does not properly handle when an input uses an alternate encoding that is valid for the control sphere to which the input is being sent.).
How can I check PyPI dependencies for CVE-2023-26302?
Run the dependency tree command: 'pip show markdown-it-py'. 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-jrwr-5x3p-hvc3",
  "modified" : "2024-09-30T16:57:59Z",
  "published" : "2023-02-23T00:30:40Z",
  "aliases" : [ "CVE-2023-26302" ],
  "summary" : "markdown-it-py Denial of Service vulnerability in the command line interface",
  "details" : "Denial of service could be caused to the command line interface of markdown-it-py, before v2.2.0, if an attacker was allowed to use invalid UTF-8 characters as input.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "markdown-it-py"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.2.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-26302"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/executablebooks/markdown-it-py/pull/247"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/executablebooks/markdown-it-py/commit/53ca3e9c2b9e9b295f6abf7f4ad2730a9b70f68c"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/executablebooks/markdown-it-py"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/executablebooks/markdown-it-py/releases/tag/v2.2.0"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pypa/advisory-database/tree/main/vulns/markdown-it-py/PYSEC-2023-23.yaml"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-173" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-02-23T19:40:54Z",
    "nvd_published_at" : "2023-02-22T23:15:00Z"
  }
}