Skip to content

[Low][ssr] bq-style allows CSS declaration injection from untrusted style objects #176

Description

@JosunLP

Severity: 🟢 Low (CSS injection — no HTML breakout)

Location

src/ssr/renderer.ts:140-150 (setStyle).

Description

Style property names/values from an evaluated bq-style object are concatenated into the inline style attribute with no CSS-level validation. Attribute-level escaping prevents HTML breakout (" is entity-encoded on serialize), so this is not XSS, but untrusted style objects can inject arbitrary extra declarations for UI-redress/clickjacking or data exfiltration (position: fixed, background: url(...)).

Reproduced: { width: 'x;} body{display:none' }style="width: x;} body{display:none;" (contained within the attribute, but the extra declaration is injected).

Suggested fix

Validate declaration values (reject ;/}/url( in untrusted values, or run through a CSS property/value allowlist) before concatenation.


Filed as part of a full-codebase security & correctness audit.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinglow-priorityLow severitysecurityChanges to the security modulessrChanges to the ssr module

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions