6.3medium
Cross-site Scripting (XSS) vulnerability due to improper HTML escaping in qwik
- Severity
- 6.3medium CVSS:3.1 by GitHub_M
- Exploit likelihood
- 0.50% (higher than 44% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-2rwj-7xq8-4gx4
Description
Qwik is a performance focused javascript framework. A potential mutation XSS vulnerability exists in Qwik for versions up to but not including 1.6.0. Qwik improperly escapes HTML on server-side rendering. It converts strings according to the rules found in the `render-ssr.ts` file. It sometimes causes the situation that the final DOM tree rendered on browsers is different from what Qwik expects on server-side rendering. This may be leveraged to perform XSS attacks, and a type of the XSS is known as mXSS (mutation XSS). This has been resolved in qwik version 1.6.0 and @builder.io/qwik version 1.7.3. All users are advised to upgrade. There are no known workarounds for this vulnerability.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| QwikDev qwik | @builder.io/qwik: < 1.7.3, qwik: < 1.6.0, before 1.6.0 | CVE List |
| @builder.io/qwik (npm) | before 1.7.3 | GitHub Advisory Database |
| qwik qwik | before 1.7.3 | NVD |
All scores
| GitHub_M | 6.3medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:L |
| GitHub | 6.3medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:L |
| GitHub | medium CVSS:4.0 | CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:A/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N |
| NVD | 6.1medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N |
Classification
SSVC (CISA-ADP): exploitation poc, automatable no, technical impact partial.
What each source says
CVE List
Qwik is a performance focused javascript framework. A potential mutation XSS vulnerability exists in Qwik for versions up to but not including 1.6.0. Qwik improperly escapes HTML on server-side rendering. It converts strings according to the rules found in the `render-ssr.ts` file. It sometimes causes the situation that the final DOM tree rendered on browsers is different from what Qwik expects on server-side rendering. This may be leveraged to perform XSS attacks, and a type of the XSS is known as mXSS (mutation XSS). This has been resolved in qwik version 1.6.0 and @builder.io/qwik version 1.7.3. All users are advised to upgrade. There are no known workarounds for this vulnerability.
GitHub Advisory Database
Summary
A potential mXSS vulnerability exists in Qwik for versions up to 1.6.0.
Details
Qwik improperly escapes HTML on server-side rendering. It converts strings according to the following rules:
- If the string is an attribute value:
"->"&->&- Other characters -> No conversion
- Otherwise:
<-><>->>&->&- Other characters -> No conversion
It sometimes causes the situation that the final DOM tree rendered on browsers is different from what Qwik expects on server-side rendering. This may be leveraged to perform XSS attacks, and a type of the XSS is known as mXSS (mutation XSS).
PoC
A vulnerable component:
import { component$ } from "@builder.io/qwik";
import { useLocation } from "@builder.io/qwik-city";
export default component$(() => {
// user input
const { url } = useLocation();
const href = url.searchParams.get("href") ?? "https://example.com";
return (
<div>
<noscript>
<a href={href}>test</a>
</noscript>
</div>
);
});
If a user accesses the following URL,
http://localhost:4173/?href=</noscript><script>alert(123)</script>
then, alert(123) will be executed.
Impact
XSS
NVD (es)
Qwik es un framework de JavaScript centrado en el rendimiento. Existe una vulnerabilidad XSS de mutación potencial en Qwik para versiones hasta la 1.6.0, pero no incluida. Qwik escapa incorrectamente de HTML en la representación del lado del servidor. Convierte cadenas de acuerdo con las reglas que se encuentran en el archivo `render-ssr.ts`. A veces causa la situación en la que el árbol DOM final renderizado en los navegadores es diferente de lo que Qwik espera en el renderizado del lado del servidor. Esto se puede aprovechar para realizar ataques XSS, y un tipo de XSS se conoce como mXSS (mutación XSS). Esto se resolvió en qwik versión 1.6.0 y @builder.io/qwik versión 1.7.3. Se recomienda a todos los usuarios que actualicen. No se conocen workarounds para esta vulnerabilidad.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2024-41677 changed 2024-08-08 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-2rwj-7xq8-4gx4 changed 2024-08-06 | CC-BY-4.0 |
| NVD | CVE-2024-41677 changed 2026-06-17 | Public domain |