GHSA-JVH5-X44Q-66JG
SVG Namespace Prefix Bypass in Static Resource Filtering Leads to Stored XSS
Texto original en inglés · Ver en español
Ciclo de vida de la vulnerabilidad
| Fecha | Fase | Evento | Detalle |
|---|---|---|---|
| Divulgación | Publicada | GHSA-JVH5-X44Q-66JG divulgada | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
Impact
Summary
DataEase's SVG content filter can be bypassed using a namespace-prefixed script element. An attacker can submit a script-bearing SVG through the static-resource upload endpoint, and the file is stored without removing the script. If a victim opens the resulting resource as a script-capable SVG document, attacker-controlled JavaScript can execute in the DataEase origin.
The upload endpoint can be reached without authentication by choosing an image suffix for its path variable. In v2.10.20–v2.10.26, the resulting static resources are also anonymously readable. In v2.10.27, static-resource reads require a valid login or share identity. This additional read restriction reduces exposure but does not correct the SVG filtering defect.
This advisory concerns stored cross-site scripting (CWE-79). It does not claim that SVG scripts execute when rendered through an ordinary image element or establish server-side code execution.
Technical details
In `StaticResourceServer.containsDangerousContent`, `element.getTagName()` is compared against a blacklist containing unqualified names such as `script`. With namespace-aware XML parsing, a script element bound to the SVG namespace and using a prefix is returned as `s:script`, which does not match `script`. Its SVG script meaning is unchanged.
Attribute and script-text substring checks do not close this gap. Script bodies can avoid the listed keywords while remaining valid executable SVG content. Passing validation leads to the original file bytes being saved and served from the same-origin `/de2api/static-resource/**` path.
The relevant v2.10.27 code paths are:
- `core/core-backend/src/main/java/io/dataease/visualization/server/StaticResourceServer.java`: `upload`, `validateSvgContent`, `containsDangerousContent`, and `writeFileIfAbsent`.
- `sdk/common/src/main/java/io/dataease/utils/WhitelistUtils.java`: URI suffix-based allowlisting of the upload route.
- `sdk/common/src/main/java/io/dataease/auth/filter/TokenFilter.java`: the separate v2.10.27 static-resource read checks.
- `core/core-backend/src/main/java/io/dataease/config/DeMvcConfig.java`: mapping stored resources to application-origin URLs.
The v2.10.27 source does set CSP and `X-Content-Type-Options: nosniff`. Its CSP allows inline scripts, so those headers do not remove this execution route.
Affected versions and validation
The namespace-sensitive filtering logic is present in every inspected release from v2.10.20 through v2.10.27. It was introduced as SVG XSS hardening in v2.10.20; this finding bypasses that hardening. Earlier releases had separately disclosed active-SVG issues.
The maintainer review confirmed the relevant source path and inspected the supplied reproducer. The reporter states that the bypass was reproduced in locally deployed official images, including v2.10.27. The maintainer review did not independently execute the reproducer or reproduce the browser behavior.
Successful exploitation requires a victim to open a script-capable SVG document under the application origin, and, for v2.10.27, to satisfy the resource-read authentication checks.
Patches
Remediation is planned for v2.10.28. A released fix has not yet been independently verified, so this draft does not identify a confirmed patched version.
The fix should use namespace URI and local name to enforce a non-executable SVG element/attribute allowlist, and prevent business upload routes from bypassing authentication through a filename-like path suffix.
Workarounds
Until a fix is available, restrict access to static-resource upload functionality and reject SVG content at a trusted validation layer where operationally feasible. Review existing untrusted SVG resources and remove unsafe files through an authorized maintenance process.
Requiring a user to log in before reading the resource is not a complete mitigation: the script executes in the browsing user's application context if that user opens the SVG document. Consider isolating untrusted image resources or applying an appropriately scoped sandbox/CSP policy after compatibility review.
References
- DataEase v2.10.27 SVG validation
https://github.com/dataease/dataease/blob/c13145b5d452beee2735429b9f65226ff5d7cc8c/core/core-backend/src/main/java/io/dataease/visualization/server/StaticResourceServer.java#L261 - DataEase v2.10.27 request allowlisting
https://github.com/dataease/dataease/blob/c13145b5d452beee2735429b9f65226ff5d7cc8c/sdk/common/src/main/java/io/dataease/utils/WhitelistUtils.java#L68 - DataEase v2.10.27 static-resource authentication
https://github.com/dataease/dataease/blob/c13145b5d452beee2735429b9f65226ff5d7cc8c/sdk/common/src/main/java/io/dataease/auth/filter/TokenFilter.java#L53 - DataEase v2.10.27 response security headers
https://github.com/dataease/dataease/blob/c13145b5d452beee2735429b9f65226ff5d7cc8c/sdk/common/src/main/java/io/dataease/filter/HtmlResourceFilter.java#L55 - Earlier active-SVG issue fixed in v2.10.20
https://github.com/dataease/dataease/security/advisories/GHSA-wx8m-vf8v-crvr - Separate template static-resource validation issue fixed in v2.10.23
https://github.com/dataease/dataease/security/advisories/GHSA-jqxj-h53x-mpvf
Thanks to leunger for reporting this issue and clarifying the affected-version conditions.
For questions about this advisory, contact [wei@fit2cloud.com](mailto:wei@fit2cloud.com).
Incluye detalles técnicos publicados por el investigador. Úselos solo para validar y corregir sus propios sistemas.
Rangos afectados
Estado del parche por paquete
| Paquete / producto | Estado | Corregida en | Desde divulgación | Última versión |
|---|---|---|---|---|
Mavenio.dataease |
Sin parche | — | — | — |
Arsenal público
Sin exploits, módulos ni PoC públicos conocidos a la fecha de verificación.
https://github.com/dataease/dataease/security/advisories/GHSA-jvh5-x44q-66jgLas referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
