Skip to content

Delete button for ActiveStorage fields uses inline Javascript #3087

@lengyelg

Description

@lengyelg

As the Delete button for ActiveStorage fields uses inline Javascript (in its onclick attribute), it's not compatible with a secure Content-Security Policy (CSP) header.

Currently the only way to get deletion to work is to disable CSP for the application (or add unsafe-inline to default-src, but that's about the same). This is wrong and greatly increases the XSS risk. Any Javascript should be loaded from .js files.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions