-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Restrict the length of requested web locks names
https://bugs.webkit.org/show_bug.cgi?id=262920 rdar://116189077 Reviewed by Brent Fulgham. Restrict the length of requested web locks names to prevent abuse. * LayoutTests/http/wpt/web-locks/lock-name-length-restriction.https-expected.txt: Added. * LayoutTests/http/wpt/web-locks/lock-name-length-restriction.https.html: Added. * Source/WebCore/Headers.cmake: * Source/WebCore/Modules/web-locks/WebLock.h: * Source/WebCore/Modules/web-locks/WebLockManager.cpp: (WebCore::WebLockManager::request): * Source/WebCore/WebCore.xcodeproj/project.pbxproj: * Source/WebKit/UIProcess/WebLockRegistryProxy.cpp: (WebKit::WebLockRegistryProxy::requestLock): Originally-landed-as: 267815.246@safari-7617-branch (85aba6b). rdar://119577065 Canonical link: https://commits.webkit.org/272250@main
- Loading branch information
1 parent
b3d60d3
commit a94a8a6
Showing
7 changed files
with
25 additions
and
1 deletion.
There are no files selected for viewing
3 changes: 3 additions & 0 deletions
3
LayoutTests/http/wpt/web-locks/lock-name-length-restriction.https-expected.txt
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,3 @@ | ||
|
||
PASS Requested lock name cannot be too long | ||
|
11 changes: 11 additions & 0 deletions
11
LayoutTests/http/wpt/web-locks/lock-name-length-restriction.https.html
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,11 @@ | ||
<!DOCTYPE HTML> | ||
<meta charset=utf-8> | ||
<title>Requested lock name cannot be too long</title> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
<script> | ||
promise_test(async t => { | ||
const name = 'x'.repeat(1025); | ||
await promise_rejects_dom(t, 'NotSupportedError', navigator.locks.request(name, lock => {})); | ||
}, "Requested lock name cannot be too long"); | ||
</script> |
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
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
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
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
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