LibTomCrypt up to 1.18.2 UTF-8 der_decode_utf8_string.c der_decode_utf8_string out-of-bounds

CVSS Meta Temp Score
CVSS is a standardized scoring system to determine possibilities of attacks. The Temp Score considers temporal factors like disclosure, exploit and countermeasures. The unique Meta Score calculates the average score of different sources to provide a normalized scoring system.
Current Exploit Price (≈)
Our analysts are monitoring exploit markets and are in contact with vulnerability brokers. The range indicates the observed or calculated exploit price to be seen on exploit markets. A good indicator to understand the monetary effort required for and the popularity of an attack.
CTI Interest Score
Our Cyber Threat Intelligence team is monitoring different web sites, mailing lists, exploit markets and social media networks. The CTI Interest Score identifies the interest of attackers and the security community for this specific vulnerability in real-time. A high score indicates an elevated risk to be targeted for this vulnerability.

A vulnerability, which was classified as critical, was found in LibTomCrypt up to 1.18.2. This affects the function der_decode_utf8_string of the file der_decode_utf8_string.c of the component UTF-8 Handler. The manipulation with an unknown input leads to a out-of-bounds vulnerability. CWE is classifying the issue as CWE-125. The software reads data past the end, or before the beginning, of the intended buffer. This is going to have an impact on confidentiality, integrity, and availability.

The weakness was published 10/03/2019 by Luigi Coniglio (werew) as confirmed bug report (GitHub Repository). It is possible to read the advisory at This vulnerability is uniquely identified as CVE-2019-17362 since 10/09/2019. It is possible to initiate the attack remotely. No form of authentication is needed for exploitation. Technical details and a public exploit are known. The reason for this vulnerability is this part of code:

/* proceed to decode */
for (y = 0; x < inlen; ) {
  /* get first byte */
  tmp = in[x++];

  /* count number of bytes */
  for (z = 0; (tmp & 0x80) && (z <= 4); z++, tmp = (tmp << 1) & 0xFF);

  if (z > 4 || (x + (z - 1) > inlen)) {

  /* decode, grab upper bits */
  tmp >>= z;

  /* grab remaining bytes */
  if (z > 1) { --z; }
  while (z-- != 0) {
	 if ((in[x] & 0xC0) != 0x80) {
	 tmp = (tmp << 6) | ((wchar_t)in[x++] & 0x3F);

  if (y < *outlen) {
	 out[y] = tmp;

A public exploit has been developed by Luigi Coniglio (werew) and been published immediately after the advisory. It is declared as proof-of-concept. The exploit is shared for download at The code used by the exploit is:

char *poc1 = "\x30\x04"                  // Start DER-sequence of length 4
             "\x0c\x02\xbf\xbf"          // Start UTF8 string of actual length 2 and evaluated length 3
             "\xaa"                      // One byte padding
             "\x30\x84\xff\xff\xff\xff"; // Start DER-sequence of length 0xffffffff (will very likely cause a crash)

Applying a patch is able to eliminate this problem. The bugfix is ready for download at



CPE 2.3info

CPE 2.2info


VulDB Meta Base Score: 8.2
VulDB Meta Temp Score: 7.8

VulDB Base Score: 7.3
VulDB Temp Score: 6.6
VulDB Vector: 🔍
VulDB Reliability: 🔍

NVD Base Score: 9.1
NVD Vector: 🔍



VulDB Base Score: 🔍
VulDB Temp Score: 🔍
VulDB Reliability: 🔍

NVD Base Score: 🔍


Class: Out-of-bounds
CWE: CWE-125 / CWE-119
ATT&CK: Unknown

Local: No
Remote: Yes

Availability: 🔍
Access: Public
Status: Proof-of-Concept
Author: Luigi Coniglio (werew)
Download: 🔍

EPSS Score: 🔍
EPSS Percentile: 🔍

Price Prediction: 🔍
Current Price Estimation: 🔍


Threat Intelligenceinfo

Interest: 🔍
Active Actors: 🔍
Active APT Groups: 🔍


Recommended: Patch
Status: 🔍

0-Day Time: 🔍
Exploit Delay Time: 🔍



10/03/2019 🔍
10/03/2019 +0 days 🔍
10/08/2019 +5 days 🔍
10/09/2019 +1 days 🔍
09/28/2020 +355 days 🔍


Researcher: Luigi Coniglio (werew)
Status: Confirmed

CVE: CVE-2019-17362 (🔍)
scip Labs:


Created: 10/08/2019 03:47 PM
Updated: 09/28/2020 06:41 AM
Changes: 10/08/2019 03:47 PM (66), 10/09/2019 01:55 PM (2), 09/28/2020 06:41 AM (1)
Complete: 🔍
Submitter: werew
Committer: werew


No comments yet. Languages: en.

Please log in to comment.

Might our Artificial Intelligence support you?

Check our Alexa App!