Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(278)

Side by Side Diff: chrome/common/extensions/csp_validator.h

Issue 8773028: Allow extenions to override the default content_security_policy, but require (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/chrome_tests.gypi ('k') | chrome/common/extensions/csp_validator.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CHROME_COMMON_EXTENSIONS_CSP_VALIDATOR_H_
6 #define CHROME_COMMON_EXTENSIONS_CSP_VALIDATOR_H_
7 #pragma once
8
9 #include <string>
10
11 namespace extensions {
12
13 namespace csp_validator {
14
15 // Checks whether the given |policy| is legal for use in the extension system.
16 // This check just ensures that the policy doesn't contain any characters that
17 // will cause problems when we transmit the policy in an HTTP header.
18 bool ContentSecurityPolicyIsLegal(const std::string& policy);
19
20 // Checks whether the given |policy| meets the minimum security requirements
21 // for use in the extension system. The philosophy behind our minimum
22 // requirements is that an XSS vulnerability in the extension should not be
23 // able to execute script, even in the precense of an active network attacker.
24 // Specifically, 'unsafe-inline' and 'unsafe-eval' are forbidden, as is
25 // script or object inclusion from insecure schemes. Also, the use of * is
26 // forbidden for scripts and objects.
27 bool ContentSecurityPolicyIsSecure(const std::string& policy);
28
29 } // namespace csp_validator
30
31 } // namespace extensions
32
33 #endif // CHROME_COMMON_EXTENSIONS_CSP_VALIDATOR_H_
OLDNEW
« no previous file with comments | « chrome/chrome_tests.gypi ('k') | chrome/common/extensions/csp_validator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698