LibTomCrypt up to 1.18.2 UTF-8 der_decode_utf8_string.c der_decode_utf8_string out-of-bounds
CVSS Meta Temp Score | Current Exploit Price (≈) | CTI Interest Score |
---|---|---|
7.4 | $0-$5k | 0.00 |
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 github.com. 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)) { return CRYPT_INVALID_PACKET; } /* decode, grab upper bits */ tmp >>= z; /* grab remaining bytes */ if (z > 1) { --z; } while (z-- != 0) { if ((in[x] & 0xC0) != 0x80) { return CRYPT_INVALID_PACKET; } tmp = (tmp << 6) | ((wchar_t)in[x++] & 0x3F); } if (y < *outlen) { out[y] = tmp; } y++; }
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 github.com. 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 github.com.
Product
Name
CPE 2.3
CPE 2.2
CVSSv3
VulDB Meta Base Score: 8.2VulDB 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: 🔍
CVSSv2
AV | AC | Au | C | I | A |
---|---|---|---|---|---|
💳 | 💳 | 💳 | 💳 | 💳 | 💳 |
💳 | 💳 | 💳 | 💳 | 💳 | 💳 |
💳 | 💳 | 💳 | 💳 | 💳 | 💳 |
Vector | Complexity | Authentication | Confidentiality | Integrity | Availability |
---|---|---|---|---|---|
unlock | unlock | unlock | unlock | unlock | unlock |
unlock | unlock | unlock | unlock | unlock | unlock |
unlock | unlock | unlock | unlock | unlock | unlock |
VulDB Base Score: 🔍
VulDB Temp Score: 🔍
VulDB Reliability: 🔍
NVD Base Score: 🔍
Exploiting
Class: Out-of-boundsCWE: 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: 🔍
0-Day | unlock | unlock | unlock | unlock |
---|---|---|---|---|
Today | unlock | unlock | unlock | unlock |
Threat Intelligence
Interest: 🔍Active Actors: 🔍
Active APT Groups: 🔍
Countermeasures
Recommended: PatchStatus: 🔍
0-Day Time: 🔍
Exploit Delay Time: 🔍
Patch: github.com
Timeline
10/03/2019 🔍10/03/2019 🔍
10/08/2019 🔍
10/09/2019 🔍
09/28/2020 🔍
Sources
Advisory: github.comResearcher: Luigi Coniglio (werew)
Status: Confirmed
CVE: CVE-2019-17362 (🔍)
scip Labs: https://www.scip.ch/en/?labs.20161013
Entry
Created: 10/08/2019 03:47 PMUpdated: 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.