Skip to content
New issue

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

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

Already on GitHub? # to your account

Extension must support Content-Security-Policy #36

Open
josefglatz opened this issue Oct 19, 2023 · 2 comments
Open

Extension must support Content-Security-Policy #36

josefglatz opened this issue Oct 19, 2023 · 2 comments
Assignees
Labels
bug Something isn't working enhancement New feature or request

Comments

@josefglatz
Copy link
Contributor

As for now, the implementation of the SCRIPT tags are added to the source code not via the right TYPO3 API way page.headerData.1234.

On top of that, it's on purpose by the TYPO3 core team, that ways like page.jsInline and others (or the way by e.g using page.headerData.1234 = TEXT adding "something" to the HEAD of the source code will not support nonce values.

The propertyuseNonce does not exist forTEXT cObjects… adding it tojsInline would be too generic.

Thus, currently the best choice probably is to use a FluidTemplate or some own custom cObject or UserFunc to trigger either AssetRenderer or PageRenderer. When I had to decide, I would go for AssetRenderer (AssetCollector)

@josefglatz josefglatz added bug Something isn't working enhancement New feature or request labels Oct 19, 2023
@helmutstrasser
Copy link
Collaborator

The Asset Renderer is no option. I tested this and it is indeed a perfect way to inject the nonce into the tag. But, it looks like the browser respectively the CSP has a problem with the type "application/supi" and blocks the script completely, denying the nonce. Removing the type makes the nonce working.
What did the trick was to implement a hash. But it looks like we have to reconsider using the type to "deactivate" the inline script.

@josefglatz
Copy link
Contributor Author

As discussed in our internal meeting:

  • cObject SUPI_JS as solution already developed in main
  • documentation for the new cObject by @garfieldius
  • release of 7.x with an updated changeLog where an integrator sees breaking changes like it's in ext:news docs.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants