Security Vulnerability Report
中文
CVE-2026-3580 CVSS 4.7 MEDIUM

CVE-2026-3580

Published: 2026-03-19 20:16:14
Last Modified: 2026-03-23 18:57:07

Description

In wolfSSL 5.8.4, constant-time masking logic in sp_256_get_entry_256_9 is optimized into conditional branches (bnez) by GCC when targeting RISC-V RV32I with -O3. This transformation breaks the side-channel resistance of ECC scalar multiplication, potentially allowing a local attacker to recover secret keys via timing analysis.

CVSS Details

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

Configurations (Affected Products)

cpe:2.3:a:wolfssl:wolfssl:5.8.4:*:*:*:*:*:*:* - VULNERABLE
wolfSSL 5.8.4

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
/* * PoC Concept for CVE-2026-3580 * This demonstrates the code pattern that leads to the vulnerability. * Compile with GCC for RISC-V with -O3 to observe the bnez instruction. */ #include <stdint.h> // Simulating the vulnerable logic in sp_256_get_entry_256_9 // Ideally should be constant time, but may become branching. void vulnerable_masking(uint32_t secret, uint32_t* result) { // Masking logic to prevent side-channel uint32_t mask = (int32_t)(secret - 1) >> 31; // Creates mask based on secret *result = (mask & 0xDEADBEEF) | (~mask & 0xCAFEBABE); } int main() { uint32_t secret_input = 0; uint32_t output = 0; // In a real attack, the attacker would vary secret_input and measure time for(int i=0; i<1000; i++) { vulnerable_masking(i, &output); } return 0; } /* * Compilation command that triggers the vulnerability: * riscv64-unknown-elf-gcc -O3 -march=rv32i -mabi=ilp32 -c poc.c -S -o poc.s * Check poc.s for 'bnez' instructions inside the masking logic. */

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-3580", "sourceIdentifier": "[email protected]", "published": "2026-03-19T20:16:14.450", "lastModified": "2026-03-23T18:57:07.400", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "In wolfSSL 5.8.4, constant-time masking logic in sp_256_get_entry_256_9 is optimized into conditional branches (bnez) by GCC when targeting RISC-V RV32I with -O3. This transformation breaks the side-channel resistance of ECC scalar multiplication, potentially allowing a local attacker to recover secret keys via timing analysis."}, {"lang": "es", "value": "En wolfSSL 5.8.4, la lógica de enmascaramiento de tiempo constante en sp_256_get_entry_256_9 se optimiza en bifurcaciones condicionales (bnez) por GCC al apuntar a RISC-V RV32I con -O3. Esta transformación rompe la resistencia a ataques de canal lateral de la multiplicación escalar ECC, lo que podría permitir a un atacante local recuperar claves secretas mediante análisis de tiempos."}], "metrics": {"cvssMetricV40": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "4.0", "vectorString": "CVSS:4.0/AV:L/AC:H/AT:P/PR:N/UI:N/VC:L/VI:N/VA:N/SC:L/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": "LOCAL", "attackComplexity": "HIGH", "attackRequirements": "PRESENT", "privilegesRequired": "NONE", "userInteraction": "NONE", "vulnConfidentialityImpact": "LOW", "vulnIntegrityImpact": "NONE", "vulnAvailabilityImpact": "NONE", "subConfidentialityImpact": "LOW", "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:L/AC:H/PR:L/UI:N/S:U/C:H/I:N/A:N", "baseScore": 4.7, "baseSeverity": "MEDIUM", "attackVector": "LOCAL", "attackComplexity": "HIGH", "privilegesRequired": "LOW", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "NONE", "availabilityImpact": "NONE"}, "exploitabilityScore": 1.0, "impactScore": 3.6}]}, "weaknesses": [{"source": "[email protected]", "type": "Secondary", "description": [{"lang": "en", "value": "CWE-203"}]}], "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/9855", "source": "[email protected]", "tags": ["Issue Tracking"]}]}}