CVE-2025-27108: Dom expressions Cross-Site Scripting Vulnerability

HIGH
Advisory Identifier: GHSA-hw62-58pr-7wc5
CVSS 7.3
CWE-116 CWE-79
Published
Advisory Summary

CVE-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

CVE Identifier CVE-2025-27108
GHSA Identifier GHSA-hw62-58pr-7wc5
Severity HIGH
CVSS v3.1 Base Score 7.3
CWE Classification CWE-116: Improper Encoding or Escaping of Output
Affected Product Dom expressions
Package Ecosystem npm
Published Date
Last Updated

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).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality Low (C:L)
Integrity Low (I:L)
Availability Low (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.

dom-expressions fixed: 0.39.5
npm install dom-expressions@0.39.5
Verify Direct and Transitive Dependencies

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

> [!NOTE] > This advisory was originally emailed to community@solidjs.com by @nsysean. To sum it up, the use of javascript's `.replace()` opens up to potential XSS vulnerabilities with the special replacement patterns beginning with `$`. Particularly, when the attributes of `Meta` tag from solid-meta are user-defined, attackers can utilise the special replacement patterns, either `$'` or `$\`` to achieve XSS. The 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. This 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.

CVE-2025-27108 Affected Dom expressions Versions

1 component(s)
Fixed Versions:
0.39.5
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?
CVE-2025-27108 is a security vulnerability in Dom expressions involving DOM Expressions has a Cross-Site Scripting (XSS) vulnerability due to improper use of string.replace under CWE-116: Improper Encoding or Escaping of Output.
Which Dom expressions versions are affected?
Affected versions include releases prior to 0.39.5 across affected packages: dom-expressions.
What version fixes CVE-2025-27108?
Upgrading to 0.39.5 (or the latest patched release for your respective branch) resolves the vulnerability.
Is dom-expressions affected?
Yes, dom-expressions is affected in releases prior to 0.39.5. Upgrade your dependency to 0.39.5 or later.
What is the CVSS score of CVE-2025-27108?
CVE-2025-27108 has a CVSS v3.1 base score of 7.3 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L.
What CWE is associated with CVE-2025-27108?
CVE-2025-27108 is classified under CWE-116: Improper Encoding or Escaping of Output (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.).
How can I check npm dependencies for CVE-2025-27108?
Run the dependency tree command: 'npm ls dom-expressions'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "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"
  }
}