Merge pull request #14724 from nextcloud/enh/nonce_for_iframes

CSP: set nonce for iframes
This commit is contained in:
Morris Jobke 2019-03-18 16:17:18 +01:00 committed by GitHub
commit 458359563b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -468,7 +468,11 @@ class EmptyContentSecurityPolicy {
}
if(!empty($this->allowedFrameDomains)) {
$policy .= 'frame-src ' . implode(' ', $this->allowedFrameDomains);
$policy .= 'frame-src ';
if(is_string($this->useJsNonce)) {
$policy .= '\'nonce-' . base64_encode($this->useJsNonce) . '\' ';
}
$policy .= implode(' ', $this->allowedFrameDomains);
$policy .= ';';
}