Do not allow newlines in CSP rules
This commit is contained in:
@@ -441,8 +441,8 @@ function validateCsp(csp) {
|
||||
if (csp === null) return null;
|
||||
|
||||
if (csp.length > 4096) return new BoxError(BoxError.BAD_FIELD, 'CSP must be less than 4096');
|
||||
|
||||
if (csp.includes('"')) return new BoxError(BoxError.BAD_FIELD, 'CSP cannot contains double quotes');
|
||||
if (csp.includes('\n')) return new BoxError(BoxError.BAD_FIELD, 'CSP cannot contain newlines');
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user