CVE-2025-27108
JSON

7.3high

Cross-site Scripting vulnerability due to improper use of string.replace in dom-expressions

Severity
7.3high CVSS:3.1 by GitHub_M
Exploit likelihood
0.29% (higher than 22% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-hw62-58pr-7wc5

Description

dom-expressions is a Fine-Grained Runtime for Performant DOM Rendering. In affected versions the use of javascript's `.replace()` opens up to potential Cross-site Scripting (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. This issue has been addressed in version 0.39.5 and all users are advised to upgrade. There are no known workarounds for this vulnerability.

Affected

Product or packageVersionsReported by
ryansolid dom-expressions< 0.39.5CVE List
dom-expressions (npm)before 0.39.5GitHub Advisory Database
ryansolid dom_expressionsbefore 0.39.5NVD

All scores

GitHub_M7.3high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L
GitHub7.3high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L
NVD6.1medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N

Classification

CWE-79CWE-116

SSVC (CISA-ADP): exploitation none, automatable yes, technical impact partial.

What each source says

CVE List

dom-expressions is a Fine-Grained Runtime for Performant DOM Rendering. In affected versions the use of javascript's `.replace()` opens up to potential Cross-site Scripting (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. This issue has been addressed in version 0.39.5 and all users are advised to upgrade. There are no known workarounds for this vulnerability.

GitHub Advisory Database

[!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.

NVD (es)

dom-expressions es un entorno de ejecución de grano fino para la representación de DOM de alto rendimiento. En las versiones afectadas, el uso de `.replace()` de javascript abre la puerta a posibles vulnerabilidades de Cross-site Scripting (XSS) con los patrones de reemplazo especiales que comienzan con `$`. En particular, cuando los atributos de la etiqueta `Meta` de solid-meta están definidos por el usuario, los atacantes pueden utilizar los patrones de reemplazo especiales, ya sea `$'` o `$\`` para lograr XSS. El paquete solid-meta tiene este problema, ya que utiliza `useAffect` y proveedores de contexto, que inyectan los activos utilizados en el encabezado html. "dom-expressions" utiliza `.replace()` para insertar los activos, lo que es vulnerable a los patrones de reemplazo especiales enumerados anteriormente. Esto significa efectivamente que si los atributos de una etiqueta de activo contuvieran datos controlados por el usuario, sería vulnerable a XSS. Por ejemplo, puede haber metaetiquetas para el protocolo Open Graph en una página de perfil de usuario, pero si los atacantes configuran la consulta del usuario con algún payload que abuse de `.replace()`, entonces podrían ejecutar código JavaScript arbitrario en el navegador web de la víctima. Además, podría almacenarse y causar más problemas. Este problema se ha solucionado en la versión 0.39.5 y se recomienda a todos los usuarios que actualicen. No se conocen workarounds para esta vulnerabilidad.

References

Sources

SourceRecordLicence
CVE ListCVE-2025-27108 changed 2025-02-24CVE Terms of Use
GitHub Advisory DatabaseGHSA-hw62-58pr-7wc5 changed 2025-02-25CC-BY-4.0
NVDCVE-2025-27108 changed 2026-06-17Public domain