Skip to content

CSP Violations Due to Unsafe Inline Styles #689

Open
@NivS-Youappi

Description

@NivS-Youappi

The library cannot be used in an environment with a strict CSP policy that doesn't allow for unsafe inline styles.
In my CSP policy I allowed inline styles with a given nonce and even after setting the nonce property for the Chart component I get a CSP violation due to inline styles being used (without the provided nonce value).

Chart component has:
<Chart nonce={value} />

And yet I get:
Refused to apply inline style because it violates the following Content Security Policy directive: "style-src 'self' 'nonce-value'". Either the 'unsafe-inline' keyword, a hash ('hash'), or a nonce ('nonce-...') is required to enable inline execution.

Is it possible to change this behavior and apply the styles in a way that won't trigger CSP violations?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions