HIGH 8.3

CVE-2026-58592: Ladybird WebAssembly ESM Dangling-Reference Code Execution

Ladybird, a web browser engine, has a memory-safety vulnerability in how it handles WebAssembly modules imported through the ESM (ECMAScript Modules) standard. When JavaScript code imports a WebAssembly function, the browser temporarily creates a function descriptor on the stack. If that descriptor is destroyed before the WebAssembly code finishes using it, the WebAssembly code ends up holding a reference to memory that's no longer valid. An attacker can exploit this stale reference to make the WebAssembly code write data to arbitrary memory locations, potentially achieving code execution within the browser's content process. The flaw requires user interaction (clicking or otherwise engaging with a malicious web page) to trigger, but no special browser features need to be enabled.

Source data · NVD / CISA · public domain

CVSS
3.1 · 8.3 HIGH · CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:H/I:H/A:H
Weaknesses (CWE)
CWE-787, CWE-825, CWE-843
Affected products
0 configuration(s)
Published / Modified
2026-07-01 / 2026-07-02

NVD description (verbatim)

Ladybird contains a dangling-reference memory-safety flaw in its WebAssembly ESM-integration module loader. When a JavaScript function is imported into a WebAssembly module via the ESM path, WebAssemblyModule.cpp passes a stack-local Wasm::FunctionType by reference to create_host_function, whose host callback captures and later reads that reference; once the ESM link-loop iteration ends the FunctionType is destroyed, leaving the callback with a dangling reference (the normal instantiate path uses a long-lived reference and is not affected). Stale result-type data lets the host callback return an empty result vector for a statically non-empty result, so the destination register retains an attacker-influenced value that is then consumed by the WASM-GC array.set handler, which bit-casts the reference low bits to an ArrayInstance pointer after only a null check, yielding an arbitrary write. A web page can chain this into code execution in the WebContent process. Verified reachable from HTML content without any instrumentation or source modification.

3 reference(s) · View on NVD →

SEC.co analysis · AI-assisted, reviewed against source

Technical summary

CVE-2026-58592 is a use-after-free vulnerability arising from a stack-local lifetime mismatch in Ladybird's WebAssemblyModule.cpp. During ESM-integration module loading, when JavaScript functions are imported into WebAssembly, the codebase passes a stack-allocated Wasm::FunctionType reference to create_host_function. The host callback captures this reference and relies on it later, but the FunctionType object is destroyed when the ESM link-loop iteration completes, leaving the callback with a dangling pointer. When the callback is invoked, it reads stale result-type metadata and returns an empty result vector despite the function signature declaring non-empty returns. This causes the destination register to retain an attacker-controlled value. The WASM-GC array.set instruction then interprets this value as an ArrayInstance pointer after only null-checking the low bits, enabling arbitrary memory write. The standard instantiate path is unaffected because it maintains a longer-lived reference. The attack surface is reachable from any HTML content loaded in the browser without requiring source modification or special instrumentation.

Business impact

This vulnerability permits remote code execution within a browser's WebContent process via a malicious or compromised web page. An attacker can execute arbitrary code with the privileges and context of the browser content process, potentially enabling credential theft, session hijacking, malware installation, or lateral movement within a user's system. Since Ladybird is an emerging open-source browser project, the blast radius depends on adoption; however, any deployment in security-sensitive environments or as a primary browser represents a significant risk. The requirement for user interaction (visiting a malicious site) moderates the threat slightly but does not eliminate it, as social engineering and drive-by downloads remain practical attack vectors.

Affected systems

Ladybird browser engine versions are affected. The source data does not specify exact version boundaries; organizations using Ladybird should verify which versions are vulnerable against the vendor's advisory and patch releases. The vulnerability is present in the ESM-integration code path, so it affects any Ladybird build that includes WebAssembly ESM support.

Exploitability

The vulnerability is moderately difficult to exploit reliably in practice, reflected in the CVSS score's high complexity rating (AC:H). An attacker must craft JavaScript and WebAssembly payloads that reliably trigger the timing and memory-layout conditions necessary for the dangling reference to be read at the correct moment and for the bit-cast of the corrupted value to form a valid-looking ArrayInstance pointer. However, the flaw is not speculative or probabilistic—it is a deterministic memory-safety error that can be reproduced. No advanced exploit techniques such as JIT side-channels or Spectre-class mechanisms are required. The requirement for user interaction (UI:R) means the attack must be delivered via a web page a user chooses to visit, ruling out passive network attacks but not social engineering.

Remediation

Fix the lifetime issue by ensuring the Wasm::FunctionType object persists for the entire duration during which the host callback might be invoked. This typically involves either allocating the FunctionType on the heap with appropriate lifetime management (shared_ptr or similar), or restructuring the ESM loader to avoid capturing references to stack-local objects. Verify against the vendor advisory for the exact patched version and apply it immediately to all Ladybird deployments. Until patched, restrict Ladybird to trusted environments and disable or isolate WebAssembly ESM imports if the browser is used to browse untrusted content.

Patch guidance

Consult the official Ladybird project repository and security advisories for patch version numbers and availability. Apply any released patches to your Ladybird installation at the earliest opportunity. If you maintain a fork or embedded integration of Ladybird, audit your version to confirm whether the dangling-reference flaw in WebAssemblyModule.cpp is present, and backport or cherry-pick the upstream fix. Test patch deployments in a controlled environment to ensure compatibility with your workflow before rolling out to production.

Detection guidance

Monitor process logs and crash reports for WebContent process crashes correlated with WebAssembly module loading or ESM imports, which may indicate exploitation attempts. Use browser security event logging (if available) to track failed or suspicious module loads. At the network level, identify and block known malicious payload domains. On the host, monitor for unexpected child processes spawned from the browser or unusual memory access patterns during WebAssembly execution. Endpoint detection and response (EDR) tools should flag code execution originating from Ladybird's WebContent process, particularly if it coincides with WebAssembly operations.

Why prioritize this

Despite not yet being listed on CISA's Known Exploited Vulnerabilities (KEV) catalog, this vulnerability merits high priority due to its combination of a complete attack chain (code execution), high CVSS score (8.3), and reachability from any web page without user-side instrumentation. The dangling-reference flaw is a deterministic memory-safety error, not a speculative one, making it likely to be exploited once public. Organizations using Ladybird should treat this as a critical security update. Even those not currently using Ladybird should note this as an example of memory-safety flaws that can arise in browser engines, particularly in complex subsystems like WebAssembly-ESM integration.

Risk score, explained

The CVSS 3.1 score of 8.3 (HIGH) reflects: high impact (confidentiality, integrity, and availability all at high risk due to code execution); low attack complexity (the exploit does not require advanced techniques, though timing conditions are non-trivial); high user interaction required (a user must visit a malicious page); and changed scope (the compromise affects the browser content process and can cascade to the user's system). The absence of authentication or special privileges required keeps the severity in the HIGH range rather than CRITICAL, but the attack surface (any web page) and deterministic nature of the flaw elevate it well above typical high-severity issues.

Frequently asked questions

What is the difference between the 'normal instantiate path' and the 'ESM path' mentioned in the description?

Ladybird supports two code paths for loading WebAssembly: a traditional instantiation path and a newer ESM (ECMAScript Modules) integration path that allows JavaScript to import WebAssembly functions as if they were standard ES6 modules. The vulnerability exists only in the ESM path because the ESM loader mistakenly passes a stack-local FunctionType reference to a callback that outlives the stack frame. The traditional instantiate path uses a reference to a long-lived object and is not affected. If you can disable or avoid ESM-based WebAssembly imports, you reduce exposure.

Can I be exploited if I do not use WebAssembly?

If you use Ladybird to browse the web, a malicious page can include WebAssembly modules as part of its content and do not require explicit user action beyond visiting the page. The vulnerability is reachable from standard HTML content, so disabling WebAssembly support entirely would eliminate the attack surface, but this is not a typical user option. Staying up to date with patches is the recommended mitigation.

Why is this vulnerability not on CISA's KEV list yet?

CISA's Known Exploited Vulnerabilities catalog is populated with vulnerabilities for which active in-the-wild exploitation has been confirmed. This CVE was published recently, and public exploits may not yet exist or may not have been reported to CISA. The absence from the KEV list does not indicate the vulnerability is low-risk; it reflects the maturity of public knowledge about active exploitation, not the severity or exploitability of the flaw itself.

What should I do if I run Ladybird in production?

Check whether your Ladybird version is affected by consulting the vendor advisory and version release notes. If vulnerable, prioritize upgrading to a patched version immediately. In the interim, restrict Ladybird to trusted networks and do not use it to browse untrusted or public web content. If Ladybird is embedded in a product, work with your vendor or upstream project to obtain and test patches before deployment.

This analysis is based on published CVE data and vendor information current as of the publication date. Version numbers, patch availability, and KEV status are subject to change. Verify all technical details and patch information against official Ladybird project advisories and releases before making deployment decisions. The CVSS score and vector string reflect the vulnerability as scored by its authoritative source. This page does not constitute security advice; consult your security team and vendor documentation for your specific environment and use case. No exploit code or weaponized proof-of-concept is provided or endorsed. Source: NVD (public-domain), retrieved 2026-08-10. Analysis generated by SEC.co (claude-haiku-4-5).