---
id: CVE-2026-102941
title: gomarkdown/markdown IsSafeURL panics on short URLs
summary: >-
  The package github.com/gomarkdown/markdown is a Go library for parsing
  Markdown text and rendering as HTML. Prior to
  0.0.0-20260724235538-61af6e1e6971, parser.IsSafeURL in parser/parser.go slices
  url[:nPath] before the len(url) >= nPath …
severity: high
cvss: 7.5
cvssVector: 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H'
cvssSource: cna
cwe:
  - CWE-125
vendor: gomarkdown
product: markdown
affected:
  - markdown < 0.0.0-20260724235538-61af6e1e6971
ssvc:
  exploitation: none
  automatable: 'yes'
  technicalImpact: partial
  timestamp: '2026-10-26T17:28:56.649619Z'
published: '2026-10-16'
updated: '2026-10-26'
sourceUpdated: '2026-10-26T17:37:11.962Z'
source: CVEORG
sourceUrl: 'https://www.cve.org/CVERecord?id=CVE-2026-102941'
references:
  - url: >-
      https://github.com/gomarkdown/markdown/security/advisories/GHSA-cv23-7vc5-jfh7
    label: >-
      https://github.com/gomarkdown/markdown/security/advisories/GHSA-cv23-7vc5-jfh7
  - url: >-
      https://github.com/gomarkdown/markdown/commit/61af6e1e69710c5ca13cfbaaaa1bc11bc763a8a9
    label: >-
      https://github.com/gomarkdown/markdown/commit/61af6e1e69710c5ca13cfbaaaa1bc11bc763a8a9
  - url: >-
      https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-102941.json
  - url: 'https://access.redhat.com/security/cve/CVE-2026-102941'
  - url: 'https://bugzilla.redhat.com/show_bug.cgi?id=2554173'
  - url: 'https://www.cve.org/CVERecord?id=CVE-2026-102941'
  - url: 'https://nvd.nist.gov/vuln/detail/CVE-2026-102941'
  - url: 'https://github.com/gomarkdown/markdown'
  - url: 'https://github.com/advisories/GHSA-cv23-7vc5-jfh7'
tags:
  - cve.org
  - csaf
  - vex
  - red-hat
  - osv
  - go
  - ghsa
epss: 0.00279
epssPercentile: 0.20213
aliases:
  - GHSA-cv23-7vc5-jfh7
ecosystem: go
patched:
  - github.com/gomarkdown/markdown 0.0.0-20260724235538-61af6e1e6971
ingestedAt: '2026-10-16T17:24:46.622Z'
---

## Overview

The package github.com/gomarkdown/markdown is a Go library for parsing Markdown text and rendering as HTML. Prior to 0.0.0-20260724235538-61af6e1e6971, parser.IsSafeURL in parser/parser.go slices url[:nPath] before the len(url) >= nPath guard. A short destination causes a slice-bounds panic when the loop reaches a relative-path prefix for which len(url) < nPath and cap(url) < nPath. The one-byte destination / is an explicit non-panic counterexample because it matches the first valid path and returns before a longer prefix is sliced. Demonstrated panic cases include empty, ., and .. destinations under those conditions. The panic is reachable when markdown.ToHTML renders untrusted Markdown with html.Safelink enabled, including an empty link destination, and is also reachable by callers that pass a short attacker-controlled URL directly to the exported parser.IsSafeURL function. An uncaught panic can terminate the calling process and cause denial of service. This issue is fixed in 0.0.0-20260724235538-61af6e1e6971.

## Affected

- `markdown < 0.0.0-20260724235538-61af6e1e6971`

## Remediation

Refer to the linked advisories for vendor-supplied fixes and affected version ranges.

## Package advisory (CVE-2026-102941)

Affected packages:

- `github.com/gomarkdown/markdown < 0.0.0-20260724235538-61af6e1e6971`

Patched in:

- `github.com/gomarkdown/markdown 0.0.0-20260724235538-61af6e1e6971`

Source: https://osv.dev/vulnerability/GHSA-cv23-7vc5-jfh7

## Vendor advisories

- **Red Hat VEX** · Important · affected: Ansible Automation Orchestrator 2026, Multicluster Global Hub · no fix planned: Multicluster Global Hub, Ansible Automation Orchestrator 2026 · updated 2026-10-21 · [vex](https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-102941.json)
