New issue
Advanced search Search tips

Issue 627398 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Jan 2017
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 1
Type: Bug-Regression

Blocked on:
issue 638117
issue 634234
issue 634263

Blocking:
issue 666845



Sign in to add a comment

Find users of net::HttpRequestHeaders::SetHeader() that pass bad values

Project Member Reported by ricea@chromium.org, Jul 12 2016

Issue description

SetHeader() expects the value to satisfy the restrictions of HttpUtil::IsValidHeaderValue(). This is enforced by a DCHECK().

http://crrev.com/2134083003 makes the restriction of IsValidHeaderValue() slightly tighter.

There are no incorrect uses discovered by the try bots, however incorrect usages may exist that are only triggered on real pages.

To check for incorrect usages:

1) Change the DCHECK() to a CHECK()
2) Check for new crashes in SetHeader()
3) Revert the change before beta.
 
Project Member

Comment 1 by bugdroid1@chromium.org, Jul 15 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/c5c1a790acc423f359c22641ac2ab0f3f9e6d7a9

commit c5c1a790acc423f359c22641ac2ab0f3f9e6d7a9
Author: ricea <ricea@chromium.org>
Date: Fri Jul 15 05:26:18 2016

Make calling SetHeader() with invalid value fatal

crrev.com/2134083003 made net::HttpUtil::IsValidHeaderValue() reject
individual CR and NL as well as CRNL.

I believe that all callers of net::HttpRequestHeaders::SetHeader() and
SetHeaderIfMissing() which use user-supplied values already verify the
value with IsValidHeaderValue() first. However, to be sure, temporarily
make it a fatal error to call SetHeader() with an invalid value.

If you see a crash attributed to this CL:

1. Associate it with the bug.
2. Follow the stack flow to work out how untrusted data ended up
being passed to SetHeader().
3. Add a call to IsValidHeaderValue() at the point where the untrusted
data was introduced. A tighter check such as IsToken() may be appopriate.

BUG= 627398 

Review-Url: https://codereview.chromium.org/2143903002
Cr-Commit-Position: refs/heads/master@{#405702}

[modify] https://crrev.com/c5c1a790acc423f359c22641ac2ab0f3f9e6d7a9/net/http/http_request_headers.cc

Comment 2 by ricea@chromium.org, Jul 19 2016

This is live in canary. No crashes so far. We should have more confidence once it goes to the dev channel.

Comment 3 by ricea@chromium.org, Aug 3 2016

Non-update: this is live in dev. No crashes so far. I will leave it another week then revert and close this bug.

Comment 4 by ricea@chromium.org, Aug 4 2016

Update: we have 12 crashes. I found this bug:  Issue 634225 

Comment 5 by ricea@chromium.org, Aug 4 2016

Blockedon: 634234

Comment 6 by ricea@chromium.org, Aug 4 2016

Only one other root cause so far:  issue 634234 

Comment 7 by ricea@chromium.org, Aug 4 2016

I spoke too soon. One more:  issue 634263 . There's no known root cause for this one, and I suspect memory corruption.
Blockedon: 634263

Comment 9 Deleted

Comment 10 by ricea@chromium.org, Aug 16 2016

Blockedon: 638117
Issue 638117 is another. Garbage In Garbage Out for Cookie headers.
Project Member

Comment 11 by bugdroid1@chromium.org, Aug 26 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/6c2cdfb89375fe0734615bd8081283d25fb0aad5

commit 6c2cdfb89375fe0734615bd8081283d25fb0aad5
Author: ricea <ricea@chromium.org>
Date: Fri Aug 26 02:29:04 2016

Revert of Make calling SetHeader() with invalid value fatal (patchset #1 id:1 of https://codereview.chromium.org/2143903002/ )

Reason for revert:
This CL has served its purpose of finding bad callers of SetHeader() and should be reverted before the branch point.

Original issue's description:
> Make calling SetHeader() with invalid value fatal
>
> crrev.com/2134083003 made net::HttpUtil::IsValidHeaderValue() reject
> individual CR and NL as well as CRNL.
>
> I believe that all callers of net::HttpRequestHeaders::SetHeader() and
> SetHeaderIfMissing() which use user-supplied values already verify the
> value with IsValidHeaderValue() first. However, to be sure, temporarily
> make it a fatal error to call SetHeader() with an invalid value.
>
> If you see a crash attributed to this CL:
>
> 1. Associate it with the bug.
> 2. Follow the stack flow to work out how untrusted data ended up
> being passed to SetHeader().
> 3. Add a call to IsValidHeaderValue() at the point where the untrusted
> data was introduced. A tighter check such as IsToken() may be appopriate.
>
> BUG= 627398 
>
> Committed: https://crrev.com/c5c1a790acc423f359c22641ac2ab0f3f9e6d7a9
> Cr-Commit-Position: refs/heads/master@{#405702}

R=mmenke@chromium.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG= 627398 

Review-Url: https://codereview.chromium.org/2268423004
Cr-Commit-Position: refs/heads/master@{#414633}

[modify] https://crrev.com/6c2cdfb89375fe0734615bd8081283d25fb0aad5/net/http/http_request_headers.cc

Comment 12 by ricea@chromium.org, Aug 26 2016

Status: Fixed (was: Assigned)

Comment 13 by ricea@chromium.org, Nov 21 2016

Blocking: 666845

Comment 14 by ricea@chromium.org, Nov 21 2016

Labels: -Pri-2 -Type-Feature Stability-Crash M-54 Merge-Request-54 Pri-1 Type-Bug-Regression
Status: Assigned (was: Fixed)
The fix never made it to the stable branch. This is causing crashes in stable: see issue 666845.

Merging would be trivial and safe.

Comment 15 by dimu@chromium.org, Nov 21 2016

Labels: -Merge-Request-54 Merge-Review-54 Hotlist-Merge-Review
[Automated comment] Request affecting a post-stable build (M54), manual review required.
Labels: TE-NeedsTriageHelp
Adding TE-NeedsTriageHelp as its out of scope from TE end.
Status: Fixed (was: Assigned)
M55 has shipped. The fix was already in M55, so there is no longer anything to do here.

Comment 18 by ricea@chromium.org, Jan 18 2017

Labels: -Hotlist-Merge-Review -ReleaseBlock-Beta -M-54 -Merge-Review-54 -TE-NeedsTriageHelp
Components: Internals>Network
Components: -Internals>Network>HTTP

Sign in to add a comment