diff options
author | Lukas Reschke <lukas@statuscode.ch> | 2017-03-16 15:16:20 +0100 |
---|---|---|
committer | Lukas Reschke <lukas@statuscode.ch> | 2017-03-16 15:16:20 +0100 |
commit | adfd1e63f67a49e69d0c7949b8b06ad7662f6a85 (patch) | |
tree | 8907c3fbf72f18c9f64f3951b1174d4386d5bd59 /tests/lib/Security | |
parent | 793d7d1bd75ef1e35cc29aef5ac03dc95aa248bb (diff) | |
download | nextcloud-server-adfd1e63f67a49e69d0c7949b8b06ad7662f6a85.tar.gz nextcloud-server-adfd1e63f67a49e69d0c7949b8b06ad7662f6a85.zip |
Add base-uri to CSP policy
As per https://twitter.com/we1x/status/842032709543333890 a nice security hardening
Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
Diffstat (limited to 'tests/lib/Security')
-rw-r--r-- | tests/lib/Security/CSP/ContentSecurityPolicyManagerTest.php | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/lib/Security/CSP/ContentSecurityPolicyManagerTest.php b/tests/lib/Security/CSP/ContentSecurityPolicyManagerTest.php index d463e7c648c..4d70d4fa28f 100644 --- a/tests/lib/Security/CSP/ContentSecurityPolicyManagerTest.php +++ b/tests/lib/Security/CSP/ContentSecurityPolicyManagerTest.php @@ -60,7 +60,7 @@ class ContentSecurityPolicyManagerTest extends \Test\TestCase { $expected->addAllowedImageDomain('anotherdomain.de'); $expected->addAllowedImageDomain('example.org'); $expected->addAllowedChildSrcDomain('childdomain'); - $expectedStringPolicy = 'default-src \'none\';script-src \'self\' \'unsafe-inline\' \'unsafe-eval\';style-src \'self\' \'unsafe-inline\';img-src \'self\' data: blob: anotherdomain.de example.org;font-src \'self\' mydomain.com example.com anotherFontDomain;connect-src \'self\';media-src \'self\';child-src childdomain'; + $expectedStringPolicy = 'default-src \'none\';base-uri \'none\';script-src \'self\' \'unsafe-inline\' \'unsafe-eval\';style-src \'self\' \'unsafe-inline\';img-src \'self\' data: blob: anotherdomain.de example.org;font-src \'self\' mydomain.com example.com anotherFontDomain;connect-src \'self\';media-src \'self\';child-src childdomain'; $this->assertEquals($expected, $this->contentSecurityPolicyManager->getDefaultPolicy()); $this->assertSame($expectedStringPolicy, $this->contentSecurityPolicyManager->getDefaultPolicy()->buildPolicy()); |