Security Vulnerability Report
中文
CVE-2026-5503 CVSS 9.1 CRITICAL

CVE-2026-5503

Published: 2026-04-09 23:17:01
Last Modified: 2026-04-27 17:53:27

Description

In TLSX_EchChangeSNI, the ctx->extensions branch set extensions unconditionally even when TLSX_Find returned NULL. This caused TLSX_UseSNI to attach the attacker-controlled publicName to the shared WOLFSSL_CTX when no inner SNI was configured. TLSX_EchRestoreSNI then failed to clean it up because its removal was gated on serverNameX != NULL. The inner ClientHello was sized before the pollution but written after it, causing TLSX_SNI_Write to memcpy 255 bytes past the allocation boundary.

CVSS Details

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

Configurations (Affected Products)

cpe:2.3:a:wolfssl:wolfssl:*:*:*:*:*:*:*:* - VULNERABLE
wolfSSL (具体受影响版本请参考官方补丁PR #10102)

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
/* * PoC for CVE-2026-5503 (wolfSSL Buffer Overflow) * This code demonstrates the context setup required to trigger the vulnerability. * Compile with: gcc -o poc_cve2026_5503 poc_cve2026_5503.c -lwolfssl */ #include <wolfssl/ssl.h> #include <wolfssl/wolfcrypt/error.h> #include <stdio.h> #include <stdlib.h> #include <string.h> int main() { WOLFSSL_CTX* ctx; WOLFSSL* ssl; int ret; // Initialize wolfSSL library wolfSSL_Init(); // Create WOLFSSL_CTX ctx = wolfSSL_CTX_new(wolfTLSv1_3_client_method()); if (ctx == NULL) { fprintf(stderr, "Error creating WOLFSSL_CTX\n"); return 1; } // Setup ECH (Encrypted ClientHello) with malicious config // The specific publicName here triggers the unconditional extension set const char* ech_config_list = "...malformed_ech_config..."; ret = wolfSSL_CTX_SetEchConfigs(ctx, ech_config_list, strlen(ech_config_list)); if (ret != SSL_SUCCESS) { printf("ECH config setup failed (expected in some envs), continuing...\n"); } // Create WOLFSSL object ssl = wolfSSL_new(ctx); if (ssl == NULL) { fprintf(stderr, "Error creating WOLFSSL object\n"); wolfSSL_CTX_free(ctx); return 1; } // Simulate connecting to a server that triggers the SNI write path // In a real scenario, this would involve a network handshake where // TLSX_EchChangeSNI is called before TLSX_SNI_Write. printf("wolfSSL object created. Triggering handshake logic...\n"); // Logic to trigger the bug would be inside the handshake state machine // specifically when TLSX_EchRestoreSNI fails to clean up serverNameX. // Cleanup wolfSSL_free(ssl); wolfSSL_CTX_free(ctx); wolfSSL_Cleanup(); return 0; }

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-5503", "sourceIdentifier": "[email protected]", "published": "2026-04-09T23:17:01.257", "lastModified": "2026-04-27T17:53:27.263", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "In TLSX_EchChangeSNI, the ctx->extensions branch set extensions unconditionally even when TLSX_Find returned NULL. This caused TLSX_UseSNI to attach the attacker-controlled publicName to the shared WOLFSSL_CTX when no inner SNI was configured. TLSX_EchRestoreSNI then failed to clean it up because its removal was gated on serverNameX != NULL. The inner ClientHello was sized before the pollution but written after it, causing TLSX_SNI_Write to memcpy 255 bytes past the allocation boundary."}], "metrics": {"cvssMetricV40": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "4.0", "vectorString": "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:L/VA:L/SC:N/SI:N/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": 6.9, "baseSeverity": "MEDIUM", "attackVector": "NETWORK", "attackComplexity": "LOW", "attackRequirements": "NONE", "privilegesRequired": "NONE", "userInteraction": "NONE", "vulnConfidentialityImpact": "NONE", "vulnIntegrityImpact": "LOW", "vulnAvailabilityImpact": "LOW", "subConfidentialityImpact": "NONE", "subIntegrityImpact": "NONE", "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:H/A:H", "baseScore": 9.1, "baseSeverity": "CRITICAL", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "NONE", "integrityImpact": "HIGH", "availabilityImpact": "HIGH"}, "exploitabilityScore": 3.9, "impactScore": 5.2}]}, "weaknesses": [{"source": "[email protected]", "type": "Secondary", "description": [{"lang": "en", "value": "CWE-787"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:wolfssl:wolfssl:*:*:*:*:*:*:*:*", "versionEndIncluding": "5.9.0", "matchCriteriaId": "DA5C710C-46E8-470C-83AF-D33D1A40512D"}]}]}], "references": [{"url": "https://github.com/wolfSSL/wolfssl/pull/10102", "source": "[email protected]", "tags": ["Issue Tracking"]}]}}