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

Issue 304313003: Allow view-source of pages fully-blocked by Blink's XSS filter. (Closed)

Created:
6 years, 6 months ago by Tom Sepez
Modified:
6 years, 5 months ago
CC:
chromium-reviews, jasvir1
Visibility:
Public.

Description

Allow view-source of pages fully blocked by blinks XSS filter. Unlike the other kinds of errors which are detected earlier in navigation (SSL certs, etc), when the Blink reflected XSS filter encounters an XSS and the page needs to be blocked (per the server's request), we already are have a commited navigation, and are well past the point where interstitials and the like would do us any good. Consequently, blink just aborts the load, and schedules a navigation to data:, with history replacement enabled, so that the offending entry is lost (note https://codereview.chromium.org/301163006/ changes this behaviour blink-side to add to the back-forward list). This is less than ideal when a webmaster would like to do a view-source on the offending page so as to diagnose the cause, so what I've done is to set up a way to flag the offending entry when the reflection is detected. I'd really like to just continue with navigating to data:, rather than trying to deal with the UX issue -- there's nothing to be done, and screaming about XSS isn't helpful to the user -- and we aren't going to ever add a "revisit the page with protection disabled" option neither. So, when a block is detected, we make an IPC call to flag the current entry in the navigation controller. The navigation then continues to data:,. When we encounter a view-source on the data:, page URL, we check if the previous page was explicitly flagged prior to the block. If so, show its source instead. Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=283728

Patch Set 1 #

Total comments: 1

Patch Set 2 : Plumb callback through to browser and mark entry. #

Patch Set 3 : Remove stray debugging include. #

Total comments: 1

Patch Set 4 : Pass page_id. #

Patch Set 5 : Don't require keeping the old navigation entry in the actual history. #

Patch Set 6 : Rename, add comment. #

Patch Set 7 : Clear blocked_page_entry_ on any non-conforming navigation. #

Patch Set 8 : Add Unit Test. #

Total comments: 4

Patch Set 9 : Address Nasko's comments. #

Patch Set 10 : Add xss_detected_ bool and use it. #

Total comments: 5

Patch Set 11 : Better comments, TODO for persisiting state. #

Patch Set 12 : Rebase, resolve conflict. #

Patch Set 13 : Rebase for landing. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+69 lines, -0 lines) Patch
M chrome/browser/ui/browser_commands.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +11 lines, -0 lines 0 comments Download
M content/browser/frame_host/navigation_entry_impl.h View 1 2 3 4 5 6 7 8 9 10 3 chunks +11 lines, -0 lines 0 comments Download
M content/browser/frame_host/navigation_entry_impl.cc View 1 2 3 4 5 6 7 8 9 3 chunks +6 lines, -0 lines 0 comments Download
M content/browser/web_contents/web_contents_impl.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +1 line, -0 lines 0 comments Download
M content/browser/web_contents/web_contents_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +21 lines, -0 lines 0 comments Download
M content/common/frame_messages.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +6 lines, -0 lines 0 comments Download
M content/public/browser/navigation_entry.h View 1 2 3 4 5 6 7 8 9 1 chunk +3 lines, -0 lines 0 comments Download
M content/renderer/render_frame_impl.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +3 lines, -0 lines 0 comments Download
M content/renderer/render_frame_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +7 lines, -0 lines 0 comments Download

Messages

Total messages: 25 (0 generated)
Tom Sepez
Sky, here's a patch for a problem I've been scratching my head over for quite ...
6 years, 6 months ago (2014-05-30 22:51:15 UTC) #1
sky
https://codereview.chromium.org/304313003/diff/1/chrome/browser/ui/browser_commands.cc File chrome/browser/ui/browser_commands.cc (right): https://codereview.chromium.org/304313003/diff/1/chrome/browser/ui/browser_commands.cc#newcode1149 chrome/browser/ui/browser_commands.cc:1149: if (entry->GetURL() == GURL("data:,Blocked")) { Is "data:,Blocked" not a ...
6 years, 6 months ago (2014-06-01 19:55:11 UTC) #2
Tom Sepez
> Is "data:,Blocked" not a legal url that could be encountered? For example, what > ...
6 years, 6 months ago (2014-06-03 22:00:27 UTC) #3
sky
https://codereview.chromium.org/304313003/diff/40001/content/browser/web_contents/web_contents_impl.cc File content/browser/web_contents/web_contents_impl.cc (right): https://codereview.chromium.org/304313003/diff/40001/content/browser/web_contents/web_contents_impl.cc#newcode2555 content/browser/web_contents/web_contents_impl.cc:2555: NavigationEntry* entry = controller_.GetLastCommittedEntry(); How do you know lastcommittedentry ...
6 years, 6 months ago (2014-06-03 22:12:16 UTC) #4
Tom Sepez
+nate, nasko for suggestions about how to make this cleaner. Thanks.
6 years, 6 months ago (2014-06-06 20:01:03 UTC) #5
Tom Sepez
Reviewers, please review. I'd like to try to land this.
6 years, 6 months ago (2014-06-10 22:39:05 UTC) #6
sky
LGTM
6 years, 6 months ago (2014-06-10 22:44:27 UTC) #7
nasko
Just a few minor comments. https://codereview.chromium.org/304313003/diff/140001/content/browser/frame_host/navigation_controller_impl.h File content/browser/frame_host/navigation_controller_impl.h (right): https://codereview.chromium.org/304313003/diff/140001/content/browser/frame_host/navigation_controller_impl.h#newcode348 content/browser/frame_host/navigation_controller_impl.h:348: linked_ptr<NavigationEntryImpl> blocked_page_entry_; Why not ...
6 years, 6 months ago (2014-06-10 23:21:30 UTC) #8
Tom Sepez
On 2014/06/10 23:21:30, nasko wrote: > Just a few minor comments. > > https://codereview.chromium.org/304313003/diff/140001/content/browser/frame_host/navigation_controller_impl.h > ...
6 years, 6 months ago (2014-06-10 23:45:14 UTC) #9
nasko
LGTM
6 years, 6 months ago (2014-06-11 16:28:12 UTC) #10
Tom Sepez
+brettw for OWNERS review of content/public and content/renderer.
6 years, 6 months ago (2014-06-11 17:10:36 UTC) #11
Tom Sepez
@brettw - ping?
6 years, 6 months ago (2014-06-17 21:05:18 UTC) #12
brettw
Oh sorry. I was looking at this before and I was trying to think of ...
6 years, 6 months ago (2014-06-18 05:16:57 UTC) #13
brettw
Looking at the history of this, I liked the general approach of Patch Set 4 ...
6 years, 6 months ago (2014-06-18 18:00:34 UTC) #14
Tom Sepez
@brettw - is Patch Set #10 what you had in mind? Thanks.
6 years, 6 months ago (2014-06-18 21:41:49 UTC) #15
brettw
Yeah. LGTM https://codereview.chromium.org/304313003/diff/180001/chrome/browser/ui/browser_commands.cc File chrome/browser/ui/browser_commands.cc (right): https://codereview.chromium.org/304313003/diff/180001/chrome/browser/ui/browser_commands.cc#newcode1149 chrome/browser/ui/browser_commands.cc:1149: // If blink sent us to its ...
6 years, 6 months ago (2014-06-18 21:51:41 UTC) #16
nasko
https://codereview.chromium.org/304313003/diff/180001/content/browser/frame_host/navigation_entry_impl.h File content/browser/frame_host/navigation_entry_impl.h (right): https://codereview.chromium.org/304313003/diff/180001/content/browser/frame_host/navigation_entry_impl.h#newcode333 content/browser/frame_host/navigation_entry_impl.h:333: bool xss_detected_; Is this supposed to be serialized for ...
6 years, 6 months ago (2014-06-18 21:54:49 UTC) #17
Tom Sepez
https://codereview.chromium.org/304313003/diff/180001/chrome/browser/ui/browser_commands.cc File chrome/browser/ui/browser_commands.cc (right): https://codereview.chromium.org/304313003/diff/180001/chrome/browser/ui/browser_commands.cc#newcode1149 chrome/browser/ui/browser_commands.cc:1149: // If blink sent us to its blocked-page URL, ...
6 years, 6 months ago (2014-06-18 22:13:22 UTC) #18
nasko
https://codereview.chromium.org/304313003/diff/180001/content/browser/frame_host/navigation_entry_impl.h File content/browser/frame_host/navigation_entry_impl.h (right): https://codereview.chromium.org/304313003/diff/180001/content/browser/frame_host/navigation_entry_impl.h#newcode333 content/browser/frame_host/navigation_entry_impl.h:333: bool xss_detected_; On 2014/06/18 22:13:22, Tom Sepez wrote: > ...
6 years, 6 months ago (2014-06-18 22:17:24 UTC) #19
Tom Sepez
> > Is this supposed to be serialized for session restore purposes? > > Probably. ...
6 years, 6 months ago (2014-06-18 22:30:56 UTC) #20
nasko
On 2014/06/18 22:30:56, Tom Sepez wrote: > > > Is this supposed to be serialized ...
6 years, 6 months ago (2014-06-19 22:55:54 UTC) #21
Tom Sepez
Blink side has finally landed, now this can proceed.
6 years, 5 months ago (2014-07-16 17:39:25 UTC) #22
Tom Sepez
The CQ bit was checked by tsepez@chromium.org
6 years, 5 months ago (2014-07-16 17:52:22 UTC) #23
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/tsepez@chromium.org/304313003/240001
6 years, 5 months ago (2014-07-16 17:55:50 UTC) #24
commit-bot: I haz the power
6 years, 5 months ago (2014-07-17 09:43:47 UTC) #25
Message was sent while issue was closed.
Change committed as 283728

Powered by Google App Engine
This is Rietveld 408576698