CVE-2025-27108: Dom expressions Cross-Site Scripting Vulnerability
HIGHCVE-2025-27108 is a HIGH (CVSS 7.3) cross-site scripting vulnerability (CWE-116: Improper Encoding or Escaping of Output) affecting Dom expressions libraries in the npm ecosystem. The issue involves dom expressions has a cross-site scripting (xss) vulnerability due to improper use of string.replace. Remediation is available by upgrading affected packages to version 0.39.5.
CVE-2025-27108 at a Glance
Security Impact
CVSS: 7.3
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L).
How to Fix CVE-2025-27108
To remediate this vulnerability, upgrade all affected Dom expressions dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
npm install dom-expressions@0.39.5
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls dom-expressions
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2025-27108, inspect your project dependencies using npm:
npm ls dom-expressions
Analyze the terminal output to locate any version of Dom expressions in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.39.5), your application is affected.
Note: The npm ls dom-expressions command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-116: Improper Encoding or Escaping of Output, where the product prepares a structured message for communication with another component, but encoding or escaping of the data is either missing or done incorrectly. as a result, the intended structure of the message is not preserved. In Dom expressions, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2025-27108 Affected Dom expressions Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
dom-expressions
|
npm |
< 0.39.5
|
0.39.5
|
References
Frequently Asked Questions
What is CVE-2025-27108?
Which Dom expressions versions are affected?
What version fixes CVE-2025-27108?
Is dom-expressions affected?
What is the CVSS score of CVE-2025-27108?
What CWE is associated with CVE-2025-27108?
How can I check npm dependencies for CVE-2025-27108?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-hw62-58pr-7wc5",
"modified" : "2025-02-25T17:49:58Z",
"published" : "2025-02-25T17:49:57Z",
"aliases" : [ "CVE-2025-27108" ],
"summary" : "DOM Expressions has a Cross-Site Scripting (XSS) vulnerability due to improper use of string.replace",
"details" : "> [!NOTE] \n> This advisory was originally emailed to community@solidjs.com by @nsysean.\n\nTo sum it up, the use of javascript's `.replace()` opens up to potential XSS vulnerabilities with the special replacement patterns beginning with `$`.\n\nParticularly, when the attributes of `Meta` tag from solid-meta are user-defined, attackers can utilise the special replacement patterns, either `$'` or `$\\`` to achieve XSS.\n\nThe solid-meta package has this issue since it uses `useAffect` and context providers, which injects the used assets in the html header. \"dom-expressions\" uses `.replace()` to insert the assets, which is vulnerable to the special replacement patterns listed above. \n\nThis effectively means that if the attributes of an asset tag contained user-controlled data, it would be vulnerable to XSS. For instance, there might be meta tags for the open graph protocol in a user profile page, but if attackers set the user query to some payload abusing `.replace()`, then they could execute arbitrary javascript in the victim's web browser. Moreover, it could be stored and cause more problems.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "dom-expressions"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "0.39.5"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/ryansolid/dom-expressions/security/advisories/GHSA-hw62-58pr-7wc5"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-27108"
}, {
"type" : "WEB",
"url" : "https://github.com/ryansolid/dom-expressions/commit/521f75dfa89ed24161646e7007d9d7d21da07767"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/ryansolid/dom-expressions"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-116", "CWE-79" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2025-02-25T17:49:57Z",
"nvd_published_at" : "2025-02-21T22:15:14Z"
}
}