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

Issue 2972073002: Mitigate the pushState IPC storm DoS. (Closed)

Created:
3 years, 5 months ago by palmer
Modified:
3 years, 5 months ago
CC:
blink-reviews, blink-reviews-frames_chromium.org, chromium-reviews
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Mitigate the pushState IPC storm DoS. This is nothing like what the ultimate, true solution should look like. It does seem to work for the narrow problem of calling history.pushState in a tight loop, however. BUG=394296 Review-Url: https://codereview.chromium.org/2972073002 Cr-Commit-Position: refs/heads/master@{#485498} Committed: https://chromium.googlesource.com/chromium/src/+/95558ee76640b366e8b775bd93483b99af379f55

Patch Set 1 #

Patch Set 2 : Move the check to |StateObjectAdded|. #

Total comments: 2

Patch Set 3 : Simpler data model. Thanks dcheng! #

Total comments: 9

Patch Set 4 : Fix obvious bugs noted in comments! #

Total comments: 4

Patch Set 5 : Add a LayoutTest; give the bikeshed a bit o' wainscoting #

Total comments: 6

Patch Set 6 : Try testharness.js test instead of old-style. #

Patch Set 7 : Make the test work (thanks dcheng!), move the flooding test per kinuko. #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+55 lines, -0 lines) Patch
A third_party/WebKit/LayoutTests/fast/loader/stateobjects/spam-pushstate-then-throttled.html View 1 2 3 4 5 6 1 chunk +23 lines, -0 lines 1 comment Download
M third_party/WebKit/Source/core/frame/History.h View 1 2 3 4 2 chunks +7 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/frame/History.cpp View 1 2 3 4 5 6 2 chunks +25 lines, -0 lines 0 comments Download

Messages

Total messages: 46 (24 generated)
palmer
dcheng: core/frame/OWNERS kinuko: FYI Thanks!
3 years, 5 months ago (2017-07-06 18:50:41 UTC) #2
Charlie Reis
Couldn't a page use replaceState to do the same thing and bypass this? And if ...
3 years, 5 months ago (2017-07-06 19:36:14 UTC) #7
palmer
> Couldn't a page use replaceState to do the same thing and bypass this? And ...
3 years, 5 months ago (2017-07-06 19:48:45 UTC) #9
dcheng
https://codereview.chromium.org/2972073002/diff/20001/third_party/WebKit/Source/core/frame/History.h File third_party/WebKit/Source/core/frame/History.h (right): https://codereview.chromium.org/2972073002/diff/20001/third_party/WebKit/Source/core/frame/History.h#newcode114 third_party/WebKit/Source/core/frame/History.h:114: mutable HostLimits host_limits; As history is tied to the ...
3 years, 5 months ago (2017-07-06 23:03:40 UTC) #14
palmer
https://codereview.chromium.org/2972073002/diff/20001/third_party/WebKit/Source/core/frame/History.h File third_party/WebKit/Source/core/frame/History.h (right): https://codereview.chromium.org/2972073002/diff/20001/third_party/WebKit/Source/core/frame/History.h#newcode114 third_party/WebKit/Source/core/frame/History.h:114: mutable HostLimits host_limits; > As history is tied to ...
3 years, 5 months ago (2017-07-06 23:53:06 UTC) #15
dcheng
On 2017/07/06 23:53:06, palmer wrote: > https://codereview.chromium.org/2972073002/diff/20001/third_party/WebKit/Source/core/frame/History.h > File third_party/WebKit/Source/core/frame/History.h (right): > > https://codereview.chromium.org/2972073002/diff/20001/third_party/WebKit/Source/core/frame/History.h#newcode114 > ...
3 years, 5 months ago (2017-07-06 23:57:42 UTC) #16
palmer
Awesome, thanks. I'll send up a new, simplified patchset today.
3 years, 5 months ago (2017-07-07 18:04:45 UTC) #17
dcheng
https://codereview.chromium.org/2972073002/diff/40001/third_party/WebKit/Source/core/frame/History.cpp File third_party/WebKit/Source/core/frame/History.cpp (right): https://codereview.chromium.org/2972073002/diff/40001/third_party/WebKit/Source/core/frame/History.cpp#newcode126 third_party/WebKit/Source/core/frame/History.cpp:126: constexpr auto kStateUpdateLimitResetInterval = TimeDelta::FromSeconds(10); Nit: static https://codereview.chromium.org/2972073002/diff/40001/third_party/WebKit/Source/core/frame/History.cpp#newcode130 third_party/WebKit/Source/core/frame/History.cpp:130: ...
3 years, 5 months ago (2017-07-07 21:04:09 UTC) #18
Łukasz Anforowicz
Some drive-by comments... https://codereview.chromium.org/2972073002/diff/40001/third_party/WebKit/Source/core/frame/History.cpp File third_party/WebKit/Source/core/frame/History.cpp (right): https://codereview.chromium.org/2972073002/diff/40001/third_party/WebKit/Source/core/frame/History.cpp#newcode122 third_party/WebKit/Source/core/frame/History.cpp:122: bool History::IsFloodingState(const String& hostname) const { ...
3 years, 5 months ago (2017-07-07 21:05:18 UTC) #20
palmer
https://codereview.chromium.org/2972073002/diff/40001/third_party/WebKit/Source/core/frame/History.cpp File third_party/WebKit/Source/core/frame/History.cpp (right): https://codereview.chromium.org/2972073002/diff/40001/third_party/WebKit/Source/core/frame/History.cpp#newcode122 third_party/WebKit/Source/core/frame/History.cpp:122: bool History::IsFloodingState(const String& hostname) const { > |hostname| parameter ...
3 years, 5 months ago (2017-07-07 21:38:17 UTC) #21
dcheng
LGTM with a naming nit Sorry I'm bad at thinking of names =( https://codereview.chromium.org/2972073002/diff/60001/third_party/WebKit/Source/core/frame/History.h File ...
3 years, 5 months ago (2017-07-07 22:04:24 UTC) #24
dcheng
Oh... sorry... one other thing I didn't think of--is it easy to add a unit ...
3 years, 5 months ago (2017-07-07 22:05:36 UTC) #25
palmer
https://codereview.chromium.org/2972073002/diff/60001/third_party/WebKit/Source/core/frame/History.h File third_party/WebKit/Source/core/frame/History.h (right): https://codereview.chromium.org/2972073002/diff/60001/third_party/WebKit/Source/core/frame/History.h#newcode106 third_party/WebKit/Source/core/frame/History.h:106: bool IsThrottlingStateObjectChanges() const; > Sorry. I thought about this ...
3 years, 5 months ago (2017-07-07 23:22:26 UTC) #27
palmer
> Oh... sorry... one other thing I didn't think of--is it easy to add a ...
3 years, 5 months ago (2017-07-07 23:22:43 UTC) #28
dcheng
https://codereview.chromium.org/2972073002/diff/80001/third_party/WebKit/LayoutTests/fast/loader/stateobjects/spam-pushstate-then-throttled.html File third_party/WebKit/LayoutTests/fast/loader/stateobjects/spam-pushstate-then-throttled.html (right): https://codereview.chromium.org/2972073002/diff/80001/third_party/WebKit/LayoutTests/fast/loader/stateobjects/spam-pushstate-then-throttled.html#newcode11 third_party/WebKit/LayoutTests/fast/loader/stateobjects/spam-pushstate-then-throttled.html:11: function log(txt) It's generally preferred to write tests using ...
3 years, 5 months ago (2017-07-07 23:28:38 UTC) #31
kinuko
https://codereview.chromium.org/2972073002/diff/80001/third_party/WebKit/LayoutTests/fast/loader/stateobjects/spam-pushstate-then-throttled.html File third_party/WebKit/LayoutTests/fast/loader/stateobjects/spam-pushstate-then-throttled.html (right): https://codereview.chromium.org/2972073002/diff/80001/third_party/WebKit/LayoutTests/fast/loader/stateobjects/spam-pushstate-then-throttled.html#newcode43 third_party/WebKit/LayoutTests/fast/loader/stateobjects/spam-pushstate-then-throttled.html:43: -Makes kStateUpdateLimit calls to pushState() Maybe we should make ...
3 years, 5 months ago (2017-07-10 05:10:49 UTC) #34
palmer
https://codereview.chromium.org/2972073002/diff/80001/third_party/WebKit/LayoutTests/fast/loader/stateobjects/spam-pushstate-then-throttled.html File third_party/WebKit/LayoutTests/fast/loader/stateobjects/spam-pushstate-then-throttled.html (right): https://codereview.chromium.org/2972073002/diff/80001/third_party/WebKit/LayoutTests/fast/loader/stateobjects/spam-pushstate-then-throttled.html#newcode43 third_party/WebKit/LayoutTests/fast/loader/stateobjects/spam-pushstate-then-throttled.html:43: -Makes kStateUpdateLimit calls to pushState() > Maybe we should ...
3 years, 5 months ago (2017-07-10 19:42:26 UTC) #35
dcheng
Thanks, new test LGTM
3 years, 5 months ago (2017-07-10 19:45:37 UTC) #38
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2972073002/120001
3 years, 5 months ago (2017-07-10 23:08:53 UTC) #41
kinuko
https://codereview.chromium.org/2972073002/diff/120001/third_party/WebKit/LayoutTests/fast/loader/stateobjects/spam-pushstate-then-throttled.html File third_party/WebKit/LayoutTests/fast/loader/stateobjects/spam-pushstate-then-throttled.html (right): https://codereview.chromium.org/2972073002/diff/120001/third_party/WebKit/LayoutTests/fast/loader/stateobjects/spam-pushstate-then-throttled.html#newcode17 third_party/WebKit/LayoutTests/fast/loader/stateobjects/spam-pushstate-then-throttled.html:17: history.pushState("DiscardedSpamItem", "51"); I wanted to say this discarsion is ...
3 years, 5 months ago (2017-07-11 00:38:04 UTC) #42
kinuko
On 2017/07/11 00:38:04, kinuko wrote: > https://codereview.chromium.org/2972073002/diff/120001/third_party/WebKit/LayoutTests/fast/loader/stateobjects/spam-pushstate-then-throttled.html > File > third_party/WebKit/LayoutTests/fast/loader/stateobjects/spam-pushstate-then-throttled.html > (right): > > ...
3 years, 5 months ago (2017-07-11 00:38:41 UTC) #43
commit-bot: I haz the power
3 years, 5 months ago (2017-07-11 02:34:10 UTC) #46
Message was sent while issue was closed.
Committed patchset #7 (id:120001) as
https://chromium.googlesource.com/chromium/src/+/95558ee76640b366e8b775bd9348...

Powered by Google App Engine
This is Rietveld 408576698