Skip to content
OpenAdvisories
Medium · 5.9 Scanner template Public exploit CVE-2025-24963 EUVD-2025-0224GHSA-8gvc-j273-4wm5

Browser mode serves arbitrary files in vitest

Published Feb 4, 2025 · Updated Feb 12, 2025 · Assigned by GitHub_M

Description

Vitest is a testing framework powered by Vite. The `__screenshot-error` handler on the browser mode HTTP server that responds any file on the file system. Especially if the server is exposed on the network by `browser.api.host: true`, an attacker can send a request to that handler from remote to get the content of arbitrary files.This `__screenshot-error` handler on the browser mode HTTP server responds any file on the file system. This code was added by commit `2d62051`. Users explicitly exposing the browser mode server to the network by `browser.api.host: true` may get any files exposed. This issue has been addressed in versions 2.1.9 and 3.0.4. Users are advised to upgrade. There are no known workarounds for this vulnerability.

Affected products

VendorProductAffectedFixed
vitest-dev vitest >= 2.0.4, < 2.1.9, >= 3.0.0, < 3.0.4 —

Public exploits

Exploit or proof-of-concept code for this vulnerability is publicly available, which lowers the bar for attackers. Treat it as a reason to patch sooner.

Third-party code, not reviewed by us. Public PoCs are sometimes fake or contain malware. Read the code first and run it only in an isolated lab, against systems you are authorised to test.

GitHub 1 repository

Sources: PoC-in-GitHub, Metasploit Framework, Exploit-DB — updated daily. Only links are listed; no exploit code is hosted here.

Automated scanner template

A ready-made Nuclei template detects this vulnerability automatically. Vulnerabilities with public scanner templates are typically probed across the internet soon after the template appears — exposed systems should be patched first.

Source: projectdiscovery/nuclei-templates (MIT) — updated daily. Only links are listed.

Affected packages

EcosystemPackageAffectedFixedRecord
npm @vitest/browser >= 2.0.4, < 2.1.9 2.1.9 GHSA-8gvc-j273-4wm5
npm @vitest/browser >= 3.0.0, < 3.0.4 3.0.4 GHSA-8gvc-j273-4wm5

References