Astro: Arbitrary CSS injection in Astro View Transitions
Paquets affectés
| Écosystème | Paquet | Concernées | Corrigé |
|---|---|---|---|
| withastro | astro | — | — |
| npm | astro |
≥ 7.1.0, < 7.3.3 |
7.3.3 |
Description d'origine La description telle que publiée par la source (souvent en anglais).
Summary
Astro's server-side View Transition CSS generator did not keep string animation properties within their generated CSS declarations. In an application that passes attacker-controlled data into an animation property such as duration, a value containing CSS delimiters could terminate the declaration and rule, then add attacker-selected CSS to the server-rendered page.
The injected content remains inside the generated `` element. It cannot terminate that element or inject HTML or JavaScript because Astro escapes < before emitting the stylesheet.
Severity
Exploitation requires an application to pass untrusted, request-derived, or user-controlled content directly into a transition animation value. This is an uncommon application pattern, and applications using static or otherwise trusted transition values are unaffected.
The resulting capability is limited to CSS in the rendered document. The proof of concept does not demonstrate JavaScript execution, HTML injection, an origin-boundary bypass, or access to server-only data.
Details
Animation values are collected by stringifyAnimations() in packages/astro/src/runtime/server/transition.ts and passed to addAnimationProperty(). String values were converted directly with toString():
function addAnimationProperty(builder: AnimationBuilder, prop: string, value: string | number) {
let arr = builder[prop];
if (Array.isArray(arr)) {
arr.push(value.toString());
} else {
builder[prop]…
Source: CVE.org (CVE Program・cvelistV5) NVD GitHub Advisory
Références
- advisory github.com
- advisory nvd.nist.gov
- package github.com
- REDHAT Red Hat
- web security-advisories@github.com
- web security-advisories@github.com
- web security-advisories@github.com
- web security-advisories@github.com
- web github.com