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

Issue 1358433004: Correctly handle problematic nested escapes in URL paths. (Closed)

Created:
5 years, 3 months ago by Peter Kasting
Modified:
5 years, 3 months ago
Reviewers:
brettw
CC:
chromium-reviews
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Correctly handle problematic nested escapes in URL paths. Specifically, if unescaping in the input leads to the output URL containing a new escaped sequence, e.g. converting the input "%%30%30" to "%00", escape the leading '%' as "%25" to ensure the output sequence is not treated as a new valid escape sequence. This ensures that canonicalizing the same URL a second time won't make changes to it, which is important for avoiding crashes and other bugs in a variety of places in both debug and release builds. BUG=533361 TEST=Visit http://andrisatteka.blogspot.com/2015/09/a-simple-string-to-crash-google-chrome.html , hover the link there, Chrome should not crash. Committed: https://crrev.com/6982036dc15ba85cdbf7339265f030ff7582ff3b Cr-Commit-Position: refs/heads/master@{#350086}

Patch Set 1 #

Patch Set 2 : New behavior #

Total comments: 8

Patch Set 3 : Review comments #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+115 lines, -18 lines) Patch
M url/url_canon_path.cc View 1 2 3 chunks +100 lines, -18 lines 2 comments Download
M url/url_canon_unittest.cc View 1 2 1 chunk +15 lines, -0 lines 0 comments Download

Messages

Total messages: 23 (6 generated)
Peter Kasting
I'm not sure whether this is the most performant or elegant way to implement this, ...
5 years, 3 months ago (2015-09-20 23:12:03 UTC) #2
brettw
I only looked at this briefly, will think about it in more detail tomorrow morning. ...
5 years, 3 months ago (2015-09-21 05:10:33 UTC) #3
brettw
I only looked at this briefly, will think about it in more detail tomorrow morning. ...
5 years, 3 months ago (2015-09-21 05:10:34 UTC) #4
Peter Kasting
On 2015/09/21 05:10:33, brettw wrote: > I only looked at this briefly, will think about ...
5 years, 3 months ago (2015-09-21 05:49:04 UTC) #5
Peter Kasting
New snap up with agreed-upon behavior, PTAL. I went ahead and added the variable to ...
5 years, 3 months ago (2015-09-21 21:45:17 UTC) #6
brettw
Still double-checking the rest... https://codereview.chromium.org/1358433004/diff/20001/url/url_canon_path.cc File url/url_canon_path.cc (right): https://codereview.chromium.org/1358433004/diff/20001/url/url_canon_path.cc#newcode211 url/url_canon_path.cc:211: if ((next_input_index == input_len) || ...
5 years, 3 months ago (2015-09-21 22:28:34 UTC) #7
brettw
lgtm https://codereview.chromium.org/1358433004/diff/20001/url/url_canon_path.cc File url/url_canon_path.cc (right): https://codereview.chromium.org/1358433004/diff/20001/url/url_canon_path.cc#newcode199 url/url_canon_path.cc:199: const char last_unescaped_char = output->at(length - 1); Can ...
5 years, 3 months ago (2015-09-21 22:37:07 UTC) #8
Peter Kasting
Take one more look, in particular at my answer to your question about |last_unescaped_char|. https://codereview.chromium.org/1358433004/diff/20001/url/url_canon_path.cc ...
5 years, 3 months ago (2015-09-21 23:15:31 UTC) #9
brettw
lgtm https://codereview.chromium.org/1358433004/diff/40001/url/url_canon_path.cc File url/url_canon_path.cc (right): https://codereview.chromium.org/1358433004/diff/40001/url/url_canon_path.cc#newcode199 url/url_canon_path.cc:199: const char last_unescaped_char = output->at(length - 1); I ...
5 years, 3 months ago (2015-09-21 23:25:19 UTC) #10
brettw
On 2015/09/21 23:25:19, brettw wrote: > I agree my suggestion is also confusing. I don't ...
5 years, 3 months ago (2015-09-22 00:05:38 UTC) #11
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1358433004/40001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1358433004/40001
5 years, 3 months ago (2015-09-22 00:07:25 UTC) #13
commit-bot: I haz the power
Try jobs failed on following builders: mac_chromium_rel_ng on tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_rel_ng/builds/116074) win8_chromium_ng on tryserver.chromium.win (JOB_FAILED, ...
5 years, 3 months ago (2015-09-22 00:28:09 UTC) #15
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1358433004/40001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1358433004/40001
5 years, 3 months ago (2015-09-22 00:29:35 UTC) #17
commit-bot: I haz the power
Try jobs failed on following builders: mac_chromium_rel_ng on tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_rel_ng/builds/116119)
5 years, 3 months ago (2015-09-22 01:26:25 UTC) #19
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1358433004/40001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1358433004/40001
5 years, 3 months ago (2015-09-22 01:29:37 UTC) #21
commit-bot: I haz the power
Committed patchset #3 (id:40001)
5 years, 3 months ago (2015-09-22 01:54:11 UTC) #22
commit-bot: I haz the power
5 years, 3 months ago (2015-09-22 01:55:03 UTC) #23
Message was sent while issue was closed.
Patchset 3 (id:??) landed as
https://crrev.com/6982036dc15ba85cdbf7339265f030ff7582ff3b
Cr-Commit-Position: refs/heads/master@{#350086}

Powered by Google App Engine
This is Rietveld 408576698