Get a Demo

Let's Patch It!

Book a short call with one our specialists, we'll walk you through how Endor Patches work, and ask you a few questions about your environment (like your primary programming languages and repository management). We'll also send you an email right after you fill out the form, feel free to reply with any questions you have in advance!

CVE

CVE-2026-40890

Go Markdown has an Out-of-bounds Read in SmartypantsRenderer
Back to all
CVE

CVE-2026-40890

Go Markdown has an Out-of-bounds Read in SmartypantsRenderer

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

Package Versions Affected

Package Version
patch Availability
No items found.

Automatically patch vulnerabilities without upgrading

Fix Without Upgrading
Detect compatible fix
Apply safe remediation
Fix with a single pull request

CVSS Version

Severity
Base Score
CVSS Version
Score Vector
C
H
U
7.5
-
3.1
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
C
H
U
0
-
3.1
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
C
H
U
7.5
-
3.1
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

Related Resources

No items found.

References

https://github.com/gomarkdown/markdown/security/advisories/GHSA-77fj-vx54-gvh7, https://nvd.nist.gov/vuln/detail/CVE-2026-40890, https://github.com/gomarkdown/markdown/commit/759bbc3e32073c3bc4e25969c132fc520eda2778, https://github.com/gomarkdown/markdown

Severity

7.5

CVSS Score
0
10

Basic Information

Ecosystem
Base CVSS
7.5
EPSS Probability
0.00074%
EPSS Percentile
0.22404%
Introduced Version
0,v0.0.0-20180128023903-8641ad4e7688,v0.0.0-20180128022211-7b88bd6d021b,v0.0.0-20160331184037-7869a127bd88,v0.0.0-20110705202221-2b87b0e786d9,v0.0.0-20110529230031-81cefb5e7cdb,v0.0.0-20110528233718-de458292e611
Fix Available
0.0.0-20260411013819-759bbc3e3207,v0.0.0-20260411013819-759bbc3e3207,2.48.3-r1

Fix Critical Vulnerabilities Instantly

Secure your app without upgrading.
Fix Without Upgrading