- Issue created by @torotil
Nonces are an easy way to implement CSP in legacy Drupal 7 sites without resorting to unsafe-inline
directives (which kind of defeat the purpose). Nonces also allow to make inline scripts i.e. Drupal.settings can be made working without further changes.
Apart from generating the nonce and adding it to all script-tags, there is one more adjustment needed: When inserting AJAX-loaded scripts Drupal needs to forward the nonce to these scripts. This needs a minor adjustment to misc/ajax.js
.
Patch misc/ajax.js
so that it forwards existing nonces to scripts loaded via AJAX.
Review to the patch.
None.
CSP related terminology.
None.
None.
tbd
Active
7.0 ⚰️
ajax system