Denial of Service (DoS) Affecting golang.org/x/text/encoding/unicode package, versions <0.3.3


0.0
high

Snyk CVSS

    Attack Complexity Low
    Availability High

    Threat Intelligence

    Exploit Maturity Proof of concept
    EPSS 0.12% (46th percentile)
Expand this section
NVD
7.5 high
Expand this section
Red Hat
7.5 high

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-GOLANGORGXTEXTENCODINGUNICODE-609611
  • published 3 Sep 2020
  • disclosed 9 Jun 2020
  • credit Evgeny Kapun

How to fix?

Upgrade golang.org/x/text/encoding/unicode to version 0.3.3 or higher.

Overview

golang.org/x/text/encoding/unicode is an unicode package provides Unicode encodings such as UTF-16.

Affected versions of this package are vulnerable to Denial of Service (DoS). It is possible to exploit the UTF-16 decoder into entering an infinite loop, causing the program to crash or run out of memory.

PoC

package main

import ( "fmt" "golang.org/x/text/encoding/unicode" ) func main() { res, err := unicode.UTF16(unicode.BigEndian, unicode.UseBOM).NewDecoder().String(" ") fmt.Println(res, err) }