Skip to content
Heist/ feed
Back to feed
Medium

markdown-it: Quadratic complexity DoS in smartquotes rule via replaceAt string operations

Type: advisorySources: OSV

markdown-it is a Markdown parser. Versions 14.1.1 and below contain a denial-of-service vulnerability when typographer: true is enabled, due to quadratic (O(n^2)) processing in the smartquotes rule. The issue stems from repeatedly modifying strings with replaceAt(), which performs O(n) slicing and concatenation per quote character. This can cause excessive CPU consumption when parsing quote-heavy, user-supplied markdown and may let attackers degrade or disrupt service availability. Although typographer is disabled by default, many production apps enable it for smart typography, making the issue relevant. This issue has been fixed in version 14.2.0.

Products
Not specified
Affected versions
Not specified
Fixed versions
Not specified
CVEs
CVE-2026-48988
Confirmed fixed CVEs
Not specified
Updated in this feed
4 Nov 2026, 13:37 UTC · Revision 1

Source evidence

markdown-it: Quadratic complexity DoS in smartquotes rule via replaceAt string operations

core-osv · Original source

Published 17 Jun 2026, 20:54 UTC

markdown-it is a Markdown parser. Versions 14.1.1 and below contain a denial-of-service vulnerability when typographer: true is enabled, due to quadratic (O(n^2)) processing in the smartquotes rule. The issue stems from repeatedly modifying strings with replaceAt(), which performs O(n) slicing and concatenation per quote character. This can cause excessive CPU consumption when parsing quote-heavy, user-supplied markdown and may let attackers degrade or disrupt service availability. Although typographer is disabled by default, many production apps enable it for smart typography, making the issue relevant. This issue has been fixed in version 14.2.0.

osv:CVE-2026-48988
Complete source record
{
  "id": "69203cc77aa2de364c9140620a05fbe52cd353c93538e6d92b6ffdd23a1fc3ae",
  "url": "https://osv.dev/vulnerability/CVE-2026-48988",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "markdown-it: Quadratic complexity DoS in smartquotes rule via replaceAt string operations",
    "summary": "markdown-it is a Markdown parser. Versions 14.1.1 and below contain a denial-of-service vulnerability when typographer: true is enabled, due to quadratic (O(n^2)) processing in the smartquotes rule. The issue stems from repeatedly modifying strings with replaceAt(), which performs O(n) slicing and concatenation per quote character. This can cause excessive CPU consumption when parsing quote-heavy, user-supplied markdown and may let attackers degrade or disrupt service availability. Although typographer is disabled by default, many production apps enable it for smart typography, making the issue relevant. This issue has been fixed in version 14.2.0.",
    "evidence": "osv:CVE-2026-48988",
    "products": [],
    "severity": "medium",
    "structured": {
      "id": "CVE-2026-48988",
      "aliases": [
        "CVE-2026-48988",
        "GHSA-6v5v-wf23-fmfq"
      ],
      "metrics": [
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://github.com/markdown-it/markdown-it",
              "type": "GIT",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "fixed": "829797aa00353ce0b62ddeb9b4583b837b1ffd9b"
                },
                {
                  "fixed": "9ce2087562c45d1e5ddd9f76b990f4b3fbe040e5"
                }
              ],
              "database_specific": {
                "extracted_events": [
                  {
                    "cpe": "cpe:2.3:a:markdown-it_project:markdown-it:*:*:*:*:*:*:*:*",
                    "range": [
                      {
                        "introduced": "0"
                      },
                      {
                        "fixed": "14.2.0"
                      }
                    ],
                    "source": "CPE_RANGE"
                  },
                  {
                    "range": [
                      {
                        "fixed": "9ce2087562c45d1e5ddd9f76b990f4b3fbe040e5"
                      }
                    ],
                    "source": "REFERENCES_COMMIT"
                  }
                ]
              }
            }
          ],
          "versions": [
            "14.1.1",
            "14.1.0",
            "14.0.0",
            "13.0.2",
            "13.0.1",
            "13.0.0",
            "12.3.2",
            "12.3.1",
            "12.3.0",
            "12.2.0",
            "12.1.0",
            "12.0.6",
            "12.0.5",
            "12.0.4",
            "12.0.3",
            "12.0.2",
            "12.0.1",
            "12.0.0",
            "11.0.1",
            "11.0.0",
            "10.0.0",
            "9.1.0",
            "9.0.1",
            "9.0.0",
            "8.4.2",
            "8.4.1",
            "8.4.0",
            "8.3.2",
            "8.3.1",
            "8.3.0",
            "8.2.2",
            "8.2.1",
            "8.2.0",
            "8.1.0",
            "8.0.1",
            "8.0.0",
            "7.0.1",
            "7.0.0",
            "6.1.1",
            "6.1.0",
            "6.0.5",
            "6.0.4",
            "6.0.3",
            "6.0.2",
            "6.0.1",
            "6.0.0",
            "5.1.0",
            "5.0.3",
            "5.0.2",
            "5.0.1",
            "5.0.0",
            "4.4.0",
            "4.3.1",
            "4.3.0",
            "4.2.2",
            "4.2.1",
            "4.2.0",
            "4.1.2",
            "4.1.1",
            "4.1.0",
            "4.0.3",
            "4.0.2",
            "4.0.1",
            "4.0.0",
            "3.1.0",
            "3.0.7",
            "3.0.6",
            "3.0.5",
            "3.0.4",
            "3.0.3",
            "3.0.2",
            "3.0.1",
            "3.0.0",
            "2.2.1",
            "2.2.0",
            "2.1.3",
            "2.1.2",
            "2.1.1",
            "2.1.0",
            "2.0.0"
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-48988.json"
          }
        }
      ],
      "modified": "2026-10-28T02:30:36.304447051Z",
      "provider": "osv",
      "references": [
        "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/48xxx/CVE-2026-48988.json",
        "https://github.com/markdown-it/markdown-it/security/advisories/GHSA-6v5v-wf23-fmfq",
        "https://nvd.nist.gov/vuln/detail/CVE-2026-48988",
        "https://github.com/markdown-it/markdown-it/commit/9ce2087562c45d1e5ddd9f76b990f4b3fbe040e5"
      ],
      "provider_metadata": {
        "cwe_ids": [
          "CWE-400"
        ],
        "cna_assigner": "GitHub_M",
        "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/48xxx/CVE-2026-48988.json"
      }
    },
    "related_cves": [
      {
        "value": "CVE-2026-48988",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 503198,
  "published_at": "2026-06-17T20:54:06.641+00:00"
}