Skip to content

Conversation

@keesvandieren
Copy link
Contributor

@keesvandieren keesvandieren commented Dec 31, 2025

Those new directives have been added to CSP in 2022 but are not yet available in Wicket

WICKET-7172

@keesvandieren keesvandieren changed the title Add support for script-src-attr, style-src-attr Extend CSP with support for script-src-attr, style-src-attr Dec 31, 2025
Copy link
Member

@martin-g martin-g left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need a JIRA ticket for the changelog.

@keesvandieren
Copy link
Contributor Author

@martin-g martin-g changed the title Extend CSP with support for script-src-attr, style-src-attr WICKET-7172: Extend CSP with support for script-src-attr, style-src-attr Jan 5, 2026
{
if (!existingDirectiveValues.isEmpty())
{
throw new IllegalArgumentException("Directive " + this + " supports only one value");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technically this is true, but in practice only 2 values are allowed: none and 'unsafe inline'. They contradict each other so shouldn't be used together.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's hear some more opinions from other CSP users.

My personal opinion is that we should follow the standards but I don't have experience in this area.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually you are correct, my implementation doesn't support all allowed values. These should be allowed:

'none'
'unsafe-hashes'
'unsafe-inline'
'report-sample'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants