Security Vulnerability Report
中文
CVE-2026-34941 CVSS 8.1 HIGH

CVE-2026-34941

Published: 2026-04-09 19:16:24
Last Modified: 2026-04-20 18:28:46

Description

Wasmtime is a runtime for WebAssembly. Prior to 24.0.7, 36.0.7, 42.0.2, and 43.0.1, Wasmtime contains a vulnerability where when transcoding a UTF-16 string to the latin1+utf16 component-model encoding it would incorrectly validate the byte length of the input string when performing a bounds check. Specifically the number of code units were checked instead of the byte length, which is twice the size of the code units. This vulnerability can cause the host to read beyond the end of a WebAssembly's linear memory in an attempt to transcode nonexistent bytes. In Wasmtime's default configuration this will read unmapped memory on a guard page, terminating the process with a segfault. Wasmtime can be configured, however, without guard pages which would mean that host memory beyond the end of linear memory may be read and interpreted as UTF-16. A host segfault is a denial-of-service vulnerability in Wasmtime, and possibly being able to read beyond the end of linear memory is additionally a vulnerability. Note that reading beyond the end of linear memory requires nonstandard configuration of Wasmtime, specifically with guard pages disabled. This vulnerability is fixed in 24.0.7, 36.0.7, 42.0.2, and 43.0.1.

CVSS Details

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

Configurations (Affected Products)

cpe:2.3:a:bytecodealliance:wasmtime:*:*:*:*:*:rust:*:* - VULNERABLE
cpe:2.3:a:bytecodealliance:wasmtime:*:*:*:*:*:rust:*:* - VULNERABLE
cpe:2.3:a:bytecodealliance:wasmtime:*:*:*:*:*:rust:*:* - VULNERABLE
cpe:2.3:a:bytecodealliance:wasmtime:*:*:*:*:*:rust:*:* - VULNERABLE
Wasmtime < 24.0.7
24.0.0 <= Wasmtime < 36.0.7
42.0.0 <= Wasmtime < 42.0.2
43.0.0 <= Wasmtime < 43.0.1

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
# PoC Simulation of the length check logic error # This Python script demonstrates the logical flaw in the boundary check. def vulnerable_utf16_transcode_check(input_data, buffer_size_bytes): # The vulnerability: checking code units instead of bytes # UTF-16 uses 2 bytes per code unit code_units = len(input_data) # VULNERABLE CHECK: Comparing code units against buffer bytes if code_units < buffer_size_bytes: return "Bounds check passed (Vulnerable)" return "Bounds check failed" def secure_utf16_transcode_check(input_data, buffer_size_bytes): # SECURE CHECK: Converting code units to bytes first required_bytes = len(input_data) * 2 if required_bytes < buffer_size_bytes: return "Bounds check passed (Secure)" return "Bounds check failed" # Scenario: Buffer size is 10 bytes # Attacker provides 8 code units (16 bytes of data) exploit_payload = [0x0041] * 8 buffer_size = 10 print(f"Payload size: {len(exploit_payload)} code units ({len(exploit_payload)*2} bytes)") print(f"Buffer limit: {buffer_size} bytes") # Vulnerable path allows the read, causing OOB access result = vulnerable_utf16_transcode_check(exploit_payload, buffer_size) print(f"Vulnerable Logic Result: {result}") # Secure path blocks the read result_secure = secure_utf16_transcode_check(exploit_payload, buffer_size) print(f"Secure Logic Result: {result_secure}")

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-34941", "sourceIdentifier": "[email protected]", "published": "2026-04-09T19:16:23.693", "lastModified": "2026-04-20T18:28:46.393", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "Wasmtime is a runtime for WebAssembly. Prior to 24.0.7, 36.0.7, 42.0.2, and 43.0.1, Wasmtime contains a vulnerability where when transcoding a UTF-16 string to the latin1+utf16 component-model encoding it would incorrectly validate the byte length of the input string when performing a bounds check. Specifically the number of code units were checked instead of the byte length, which is twice the size of the code units. This vulnerability can cause the host to read beyond the end of a WebAssembly's linear memory in an attempt to transcode nonexistent bytes. In Wasmtime's default configuration this will read unmapped memory on a guard page, terminating the process with a segfault. Wasmtime can be configured, however, without guard pages which would mean that host memory beyond the end of linear memory may be read and interpreted as UTF-16. A host segfault is a denial-of-service vulnerability in Wasmtime, and possibly being able to read beyond the end of linear memory is additionally a vulnerability. Note that reading beyond the end of linear memory requires nonstandard configuration of Wasmtime, specifically with guard pages disabled. This vulnerability is fixed in 24.0.7, 36.0.7, 42.0.2, and 43.0.1."}], "metrics": {"cvssMetricV40": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "4.0", "vectorString": "CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:P/VC:N/VI:N/VA:H/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": "LOW", "userInteraction": "PASSIVE", "vulnConfidentialityImpact": "NONE", "vulnIntegrityImpact": "NONE", "vulnAvailabilityImpact": "HIGH", "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:L/UI:N/S:U/C:H/I:N/A:H", "baseScore": 8.1, "baseSeverity": "HIGH", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "LOW", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "NONE", "availabilityImpact": "HIGH"}, "exploitabilityScore": 2.8, "impactScore": 5.2}]}, "weaknesses": [{"source": "[email protected]", "type": "Primary", "description": [{"lang": "en", "value": "CWE-125"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:bytecodealliance:wasmtime:*:*:*:*:*:rust:*:*", "versionEndExcluding": "24.0.7", "matchCriteriaId": "5A39DBFB-CD5E-4551-8885-053DF90E277A"}, {"vulnerable": true, "criteria": "cpe:2.3:a:bytecodealliance:wasmtime:*:*:*:*:*:rust:*:*", "versionStartIncluding": "25.0.0", "versionEndExcluding": "36.0.7", "matchCriteriaId": "B5AB2157-3977-49F9-9058-6B16A2556170"}, {"vulnerable": true, "criteria": "cpe:2.3:a:bytecodealliance:wasmtime:*:*:*:*:*:rust:*:*", "versionStartIncluding": "37.0.0", "versionEndExcluding": "42.0.2", "matchCriteriaId": "1D7B70EB-93E3-4732-AB70-E6A531178941"}, {"vulnerable": true, "criteria": "cpe:2.3:a:bytecodealliance:wasmtime:*:*:*:*:*:rust:*:*", "versionStartIncluding": "43.0.0", "versionEndExcluding": "43.0.1", "matchCriteriaId": "15FD6AA4-973B-4647-9222-40FBDC16A6FD"}]}]}], "references": [{"url": "https://github.com/bytecodealliance/wasmtime/security/advisories/GHSA-hx6p-xpx3-jvvv", "source": "[email protected]", "tags": ["Vendor Advisory"]}]}}