Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"onclick" handler in template violates default content security policy #573

Open
brotkrueml opened this issue Apr 25, 2024 · 0 comments
Open

Comments

@brotkrueml
Copy link
Contributor

brotkrueml commented Apr 25, 2024

Please give us a description of what happened.

I am seeing violations of content security policies (activated in v12.4 via the feature flag for backend):

Blocked inline script attribute from 'inline:'

Because of this in Cornerstone.html:

<input id="{data.elementBaseName}" type="checkbox" data-formengine-input-name="data{data.elementBaseName}" value="1"
    {f:if(condition: data.databaseRow.tx_yoastseo_cornerstone, then: 'checked="checked"')}
    onclick="document.editform['data{data.elementBaseName}'].value=this.checked?(document.editform['data{data.elementBaseName}'].value|1):(document.editform['data{data.elementBaseName}'].value&0);TBE_EDITOR.fieldChanged('{data.tableName}','{data.vanillaUid}','{data.fieldName}','data{data.elementBaseName}');">

Please describe what you expected to happen and why.

No CSP violation with the default rules provided by TYPO3.

How can we reproduce this behavior?

Don't know, just saw the error on my Sentry instance.

But obviously, move the logic of the inline handler into a dedicated script file.

Technical info

  • TYPO3 version: 12.4.14
  • Yoast SEO version: 9.0.3
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

No branches or pull requests

1 participant