Skip to content

← Actionable
High, CVSS 7.5amended

gomarkdown/markdown IsSafeURL panics on short URLs

CVE-2026-102941GHSA-cv23-7vc5-jfh7

What to do

Vendor fix available. Upgrade each affected package to the fixed version on its release line (github.com/gomarkdown/markdown 0.0.0-20260724235538-61af6e1e6971), redeploy, then verify what is actually installed.

This page has no inventory attached, so it cannot say whether you are affected. A vendor fix is not proof that your deployment is fixed.

Affected packages

Sources

Severity and exploitation
Exploitation
No confirmed exploitation recorded. Patch Next marks exploitation only from CISA KEV.
CVSS
7.5 · CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
EPSS
  • CVE-2026-102941: 0.28% estimated exploitation activity in the next 30 days; percentile 20.41 (FIRST EPSS, 2026-11-03). This is a model estimate, not proof of exploitation or customer exposure.
Source description

As published by the source; long descriptions are shortened.

Summary IsSafeURL slices url[:nPath] before checking that len(url) = nPath, so a URL shorter than a path prefix (0, 1 or 2 bytes) triggers a slice-bounds panic, and this is reached end to end when the html.Safelink hardening flag is enabled and the input contains an empty or very short link destination, giving an unrecoverable crash DoS. Confirmed at HEAD (e08cff8; present since 2022). The defect parser/parser.go, IsSafeURL: url[:nPath] is evaluated before the nLink = nPath check. When len(url) < nPath and cap(url) < nPath, the slice expression panics. Only the relative-path loop is affected; the adjacent URIs loop is already correctly guarded (the signal that this one deviates, the same signal as the anchor). Input: IsSafeURL("") panics ([:1] cap 0), IsSafeURL(".") panics ([:2] cap 1), IsSafeURL("..") panics ([:3] cap 2), while IsSafeURL("/") returns true. End to end: markdown.ToHTML(input, html.CommonFlags|html.Safelink) with input x panics. Attacker model: (1) any service…

Dates and revisions
Published by the source
Last modified by the source
Source last checked
  1. Revision 2 · amended ·

    Amended from ghsa record GHSA-cv23-7vc5-jfh7

  2. Revision 1 · created ·

    Published from osv record GHSA-cv23-7vc5-jfh7

Agent brief

Preview the exact text before you copy it. Commands are read-only suggestions; review them before running anything.

# Patch Next advisory brief: CVE-2026-102941

Advisory: gomarkdown/markdown IsSafeURL panics on short URLs
IDs: CVE-2026-102941, GHSA-cv23-7vc5-jfh7
Record: https://patchnext.com/advisories/cve-2026-102941 (revision 2, source checked 26 Oct 2026, 15:32 UTC)
Inventory: none attached. This brief comes from a public page and does not say whether any deployment is affected.
Severity: High (CVSS 7.5)
Exploitation: no confirmed exploitation recorded. Patch Next confirms exploitation only from CISA KEV.
Vendor response: Vendor fix available; fixed versions by package: github.com/gomarkdown/markdown 0.0.0-20260724235538-61af6e1e6971. A vendor fix does not mean a deployment is fixed.

## Affected components
- Go github.com/gomarkdown/markdown: affected < 0.0.0-20260724235538-61af6e1e6971; fixed in 0.0.0-20260724235538-61af6e1e6971

## Suggested inspection (read-only)
- Go github.com/gomarkdown/markdown: check the installed version with your package manager.

## Supported action
Upgrade each affected component to a fixed version on its release line. For a transitive dependency, upgrade the parent package or add an override or constraint, then regenerate the lockfile. Redeploy every environment that ran an affected version.

## Required regression checks
- Run the test suite and a production build.
- Exercise the features that depend on github.com/gomarkdown/markdown.
- Repeat the inspection and confirm that only fixed versions remain installed.

## Rollback considerations
- Keep the previous lockfile and deployment artifact. Rolling back reinstates the vulnerable version, so apply any documented mitigation while you fix forward.

## Unresolved questions
- Which deployments run an affected version?
- Exploitation status can change. Check again before lowering the priority.
- Mark the work resolved only after the fixed version is verified in production.

## Sources
- Verified: https://osv.dev/vulnerability/GHSA-cv23-7vc5-jfh7 (OSV record GHSA-cv23-7vc5-jfh7 lists affected ranges: Go github.com/gomarkdown/markdown >=0 <0.0.0-20260724235538-61af6e1e6971 (fixed))
- Verified: https://github.com/advisories/GHSA-cv23-7vc5-jfh7 (GitHub-reviewed advisory GHSA-cv23-7vc5-jfh7 lists affected ranges: Go github.com/gomarkdown/markdown >=0 <0.0.0-20260724235538-61af6e1e6971)

Commands are suggestions: review each one before running it.

Loading voting…