dom-expressions Cross-Site Scripting Vulnerability

Vulnerability

A cross-site scripting (XSS) vulnerability has been identified in the 'dom-expressions' package, specifically in versions prior to 0.39.5. The issue arises from the improper use of JavaScript's '.replace()' method, which opens the door to XSS attacks through special replacement patterns that begin with '$'. This vulnerability is particularly concerning when the attributes of 'Meta' tags from the 'solid-meta' package are user-defined. Attackers can exploit this by injecting payloads that manipulate the '.replace()' function, potentially executing arbitrary JavaScript in the context of the victim's browser. The problem is exacerbated by the fact that such injections could be stored and lead to further exploitation.

Impact

Exploitation of this vulnerability allows for cross-site scripting attacks, where an attacker can execute arbitrary JavaScript in the context of the user's browser.

Reproduction

To reproduce this vulnerability, create a 'Meta' tag attribute in 'solid-meta' that includes user-controlled data. Inject a payload that exploits the '.replace()' method by using the '$' replacement patterns. When the 'dom-expressions' package processes this data, the payload will be executed as JavaScript in the user's browser.

Remediation

Users are advised to upgrade to version 0.39.5 or later.

Added: Jun 9, 2025, 7:46 PM
Updated: Jun 9, 2025, 7:46 PM

Vulnerability Rating

Custom Algorithm
spread
2.4
impact
1.7
exploitability
5.4
remediation
7.7
relevance
0.0
threat
4.8
urgency
2.9
incentive
1.7

Our algorithm analyzes dozens of metrics to generate these 8 key vulnerability categories, which are then combined to calculate the overall risk score.