-
Notifications
You must be signed in to change notification settings - Fork 6.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add fuzzer for parse of Permissions-Policy header
Bug: 1095641 Change-Id: I7558008667c0c3a83dbb19c9211bad78db1dd3fc Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2272611 Reviewed-by: Ian Clelland <iclelland@chromium.org> Reviewed-by: Daniel Cheng <dcheng@chromium.org> Commit-Queue: Charlie Hu <chenleihu@google.com> Cr-Commit-Position: refs/heads/master@{#785803}
- Loading branch information
Charlie Hu
authored and
Commit Bot
committed
Jul 7, 2020
1 parent
80cb822
commit 10a116f
Showing
19 changed files
with
106 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
third_party/blink/renderer/core/feature_policy/permissions_policy.dict
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# Copyright 2020 The Chromium Authors. All rights reserved. | ||
# Use of this source code is governed by a BSD-style license that can be | ||
# found in the LICENSE file. | ||
|
||
"accelerometer" | ||
"ambient-light-sensor" | ||
"autoplay" | ||
"camera" | ||
"document-domain" | ||
"document-write" | ||
"encrypted-media" | ||
"forms" | ||
"fullscreen" | ||
"geolocation" | ||
"gyroscope" | ||
"hid" | ||
"idle-detection" | ||
"layout-animations" | ||
"lazyload" | ||
"magnetometer" | ||
"microphone" | ||
"midi" | ||
"modals" | ||
"orientation-lock" | ||
"payment" | ||
"picture-in-picture" | ||
"pointer-lock" | ||
"popups" | ||
"presentation" | ||
"screen-wake-lock" | ||
"scripts" | ||
"serial" | ||
"speaker" | ||
"sync-script" | ||
"sync-xkr" | ||
"top-navigation" | ||
"unsized-media" | ||
"usb" | ||
"vertical-scroll" | ||
"vr" | ||
"\"https://example.com/\"" | ||
"*" | ||
"self" | ||
"(" | ||
")" | ||
"=" | ||
"0" | ||
"1" | ||
".0" | ||
"?0" | ||
"?1" | ||
"\"" | ||
" " |
1 change: 1 addition & 0 deletions
1
third_party/blink/renderer/core/feature_policy/permissions_policy_corpus/1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
badfeaturename |
1 change: 1 addition & 0 deletions
1
third_party/blink/renderer/core/feature_policy/permissions_policy_corpus/10
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
camera=(self "https://example.com/"), camera=(self "https://example.net/") |
1 change: 1 addition & 0 deletions
1
third_party/blink/renderer/core/feature_policy/permissions_policy_corpus/11
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
vibrate=(self "https://example.org/") |
1 change: 1 addition & 0 deletions
1
third_party/blink/renderer/core/feature_policy/permissions_policy_corpus/12
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
document-write=(self "https://example.org/") |
1 change: 1 addition & 0 deletions
1
third_party/blink/renderer/core/feature_policy/permissions_policy_corpus/13
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
vibrate=(self https://example.net/), docwrite=self |
1 change: 1 addition & 0 deletions
1
third_party/blink/renderer/core/feature_policy/permissions_policy_corpus/14
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
vibrate=*, docwrite=* |
1 change: 1 addition & 0 deletions
1
third_party/blink/renderer/core/feature_policy/permissions_policy_corpus/15
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
vibrate, fullscreen, payment |
1 change: 1 addition & 0 deletions
1
third_party/blink/renderer/core/feature_policy/permissions_policy_corpus/16
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
vibrate=src |
1 change: 1 addition & 0 deletions
1
third_party/blink/renderer/core/feature_policy/permissions_policy_corpus/2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
badfeaturename=self |
1 change: 1 addition & 0 deletions
1
third_party/blink/renderer/core/feature_policy/permissions_policy_corpus/3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
vibrate="data://badorigin" |
1 change: 1 addition & 0 deletions
1
third_party/blink/renderer/core/feature_policy/permissions_policy_corpus/4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
1.0 |
1 change: 1 addition & 0 deletions
1
third_party/blink/renderer/core/feature_policy/permissions_policy_corpus/5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
vibrate=(self) |
1 change: 1 addition & 0 deletions
1
third_party/blink/renderer/core/feature_policy/permissions_policy_corpus/6
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
vibrate=("https://example.com/") |
1 change: 1 addition & 0 deletions
1
third_party/blink/renderer/core/feature_policy/permissions_policy_corpus/7
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
docwrite=() |
1 change: 1 addition & 0 deletions
1
third_party/blink/renderer/core/feature_policy/permissions_policy_corpus/8
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
docwrite=self |
1 change: 1 addition & 0 deletions
1
third_party/blink/renderer/core/feature_policy/permissions_policy_corpus/9
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
vibrate=* |
26 changes: 26 additions & 0 deletions
26
third_party/blink/renderer/core/feature_policy/permissions_policy_fuzzer.cc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// Copyright 2020 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#include "third_party/blink/renderer/core/feature_policy/feature_policy_parser.h" | ||
|
||
#include <stddef.h> | ||
#include <stdint.h> | ||
#include <memory> | ||
|
||
#include "third_party/blink/renderer/platform/heap/handle.h" | ||
#include "third_party/blink/renderer/platform/testing/blink_fuzzer_test_support.h" | ||
#include "third_party/blink/renderer/platform/weborigin/security_origin.h" | ||
#include "third_party/blink/renderer/platform/wtf/text/wtf_string.h" | ||
#include "third_party/blink/renderer/platform/wtf/vector.h" | ||
|
||
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { | ||
static blink::BlinkFuzzerTestSupport test_support = | ||
blink::BlinkFuzzerTestSupport(); | ||
blink::PolicyParserMessageBuffer logger; | ||
scoped_refptr<const blink::SecurityOrigin> origin = | ||
blink::SecurityOrigin::CreateFromString("https://example.com/"); | ||
blink::FeaturePolicyParser::ParseHeader( | ||
g_empty_string, WTF::String(data, size), origin.get(), logger); | ||
return 0; | ||
} |