New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 658716 link

Starred by 4 users

Issue metadata

Status: Fixed
Owner:
Closed: Feb 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Android , Windows , Chrome , Mac
Pri: 3
Type: Bug

Blocking:
issue 391673



Sign in to add a comment

|offset| arguments of Range interface should be unsigned

Project Member Reported by ClusterFuzz, Oct 24 2016

Issue description

Detailed report: https://cluster-fuzz.appspot.com/testcase?key=5050838323298304

Fuzzer: ifratric-browserfuzzer-v3
Job Type: linux_ubsan_chrome
Platform Id: linux

Crash Type: Integer-overflow
Crash Address: 
Crash State:
  blink::Range::checkNodeWOffset
  blink::Range::isPointInRange
  isPointInRangeMethod
  
Regressed: https://cluster-fuzz.appspot.com/revisions?job=linux_ubsan_chrome&range=370022:370027

Minimized Testcase (0.79 Kb): https://cluster-fuzz.appspot.com/download/AMIfv94upkjvUf3G38p13Vbb6fDVruZJN9uzs1VdEh-FR8oJCV-afqqOJFPhhpX2so-7FDtlKwn0QKrYTaWFCfekxw6kzQEHRrkpql-aEJS3BFVwJQjbysYDowec6Rj3E5qiockqWFyldjs1ztxOIbqn_T9OhxogMg?testcase_id=5050838323298304

Issue filed automatically.

See https://dev.chromium.org/Home/chromium-security/bugs/reproducing-clusterfuzz-bugs for more information.
 
Components: Blink>Editing Blink>DOM
Labels: M-55 Te-Logged
Owner: tkent@chromium.org
Status: Assigned (was: Untriaged)
Possible suspect is 
https://chromium.googlesource.com/chromium/src/+/8a2aa879982c582f811a9d9ef75286b8d27aab84
tkent@, could you please take a look and help us to find correct owner if it is not related your changes.

Comment 2 by tkent@chromium.org, Oct 31 2016

Cc: tkent@chromium.org
Labels: -Pri-2 -M-55 -Restrict-View-EditIssue Hotlist-Interop OS-Android OS-Chrome OS-Mac OS-Windows Pri-3
Owner: ----
Status: Available (was: Assigned)
Summary: |offset| arguments of Range interface should be unsigned (was: Integer-overflow in blink::Range::checkNodeWOffset)
Testcase:
<script>
window.fuzzervars = {};
function GetVariable(var_type) { if(window.fuzzervars[var_type]) { return window.fuzzervars[var_type][0]; } else { return null; }}
function SetVariable(var_name, var_type) { if(!window.fuzzervars[var_type]) window.fuzzervars[var_type] = []; window.fuzzervars[var_type].push(var_name); }
function jsfuzzer() {
 /* Document*/ var var00009 = document; 
 SetVariable(var00009, 'Document'); SetVariable(var00009, 'Node');   
 var00042 = GetVariable('Document');  
 /* Selection*/ var var00131 = var00042.getSelection(); 
 var00166 = GetVariable('Node');  
 var00131.setPosition(var00166); 
 /* Range*/ var var00182 = var00131.getRangeAt(0); 
 /* boolean*/ var var00283 = var00182.isPointInRange(htmlvar00015,2147483648); 
}
</script>
<body onload=jsfuzzer()<menu id="htmlvar00015">


My CL isn't a culprit.  The problem exists for years, and my CL might make the testcase workable.

The right fix is to change |offset| arguments in Range.idl from |long| to |unsigned long|.

Owner: a.obzhirov@samsung.com
Status: Assigned (was: Available)
Yes, it is also unsigned in https://dom.spec.whatwg.org/#interface-range.
Seems to be straight forward and since nobody has done it yet, I will do it.
Blockedon: 391673
To fix it properly offsets in Range, Selection should be made unsigned.

Comment 6 by tkent@chromium.org, Feb 9 2017

Blockedon: -391673

Comment 7 by tkent@chromium.org, Feb 9 2017

Blocking: 391673

Comment 8 by tkent@chromium.org, Feb 21 2017

Cc: -tkent@chromium.org a.obzhirov@samsung.com
Owner: tkent@chromium.org
Status: Started (was: Assigned)
Project Member

Comment 9 by bugdroid1@chromium.org, Feb 21 2017

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

commit f5558c7534d4d34c0848d692432e7f0a919eb247
Author: tkent <tkent@chromium.org>
Date: Tue Feb 21 12:19:38 2017

Range: node offsets should be unsigned.

BUG= 658716 

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

[modify] https://crrev.com/f5558c7534d4d34c0848d692432e7f0a919eb247/third_party/WebKit/LayoutTests/editing/selection/extend-expected.txt
[modify] https://crrev.com/f5558c7534d4d34c0848d692432e7f0a919eb247/third_party/WebKit/LayoutTests/fast/text/selection-exceptions-expected.txt
[modify] https://crrev.com/f5558c7534d4d34c0848d692432e7f0a919eb247/third_party/WebKit/LayoutTests/fast/text/selection-exceptions.html
[modify] https://crrev.com/f5558c7534d4d34c0848d692432e7f0a919eb247/third_party/WebKit/Source/core/dom/NodeWithIndex.h
[modify] https://crrev.com/f5558c7534d4d34c0848d692432e7f0a919eb247/third_party/WebKit/Source/core/dom/Range.cpp
[modify] https://crrev.com/f5558c7534d4d34c0848d692432e7f0a919eb247/third_party/WebKit/Source/core/dom/Range.h
[modify] https://crrev.com/f5558c7534d4d34c0848d692432e7f0a919eb247/third_party/WebKit/Source/core/dom/Range.idl
[modify] https://crrev.com/f5558c7534d4d34c0848d692432e7f0a919eb247/third_party/WebKit/Source/core/dom/RangeBoundaryPoint.h
[modify] https://crrev.com/f5558c7534d4d34c0848d692432e7f0a919eb247/third_party/WebKit/Source/core/dom/RangeTest.cpp
[modify] https://crrev.com/f5558c7534d4d34c0848d692432e7f0a919eb247/third_party/WebKit/Source/core/dom/StaticRangeTest.cpp
[modify] https://crrev.com/f5558c7534d4d34c0848d692432e7f0a919eb247/third_party/WebKit/Source/core/editing/InputMethodControllerTest.cpp
[modify] https://crrev.com/f5558c7534d4d34c0848d692432e7f0a919eb247/third_party/WebKit/Source/core/editing/VisibleSelectionTest.cpp
[modify] https://crrev.com/f5558c7534d4d34c0848d692432e7f0a919eb247/third_party/WebKit/Source/core/editing/iterators/CharacterIteratorTest.cpp
[modify] https://crrev.com/f5558c7534d4d34c0848d692432e7f0a919eb247/third_party/WebKit/Source/web/tests/TextFinderTest.cpp

Comment 11 by tkent@chromium.org, Feb 22 2017

Labels: M-58
Status: Fixed (was: Started)
Project Member

Comment 12 by ClusterFuzz, Feb 22 2017

ClusterFuzz has detected this issue as fixed in range 451738:451747.

Detailed report: https://cluster-fuzz.appspot.com/testcase?key=5050838323298304

Fuzzer: ifratric-browserfuzzer-v3
Job Type: linux_ubsan_chrome
Platform Id: linux

Crash Type: Integer-overflow
Crash Address: 
Crash State:
  blink::Range::checkNodeWOffset
  blink::Range::isPointInRange
  isPointInRangeMethod
  
Sanitizer: undefined (UBSAN)

Regressed: https://cluster-fuzz.appspot.com/revisions?job=linux_ubsan_chrome&range=370022:370027
Fixed: https://cluster-fuzz.appspot.com/revisions?job=linux_ubsan_chrome&range=451738:451747

Reproducer Testcase: https://cluster-fuzz.appspot.com/download/AMIfv94upkjvUf3G38p13Vbb6fDVruZJN9uzs1VdEh-FR8oJCV-afqqOJFPhhpX2so-7FDtlKwn0QKrYTaWFCfekxw6kzQEHRrkpql-aEJS3BFVwJQjbysYDowec6Rj3E5qiockqWFyldjs1ztxOIbqn_T9OhxogMg?testcase_id=5050838323298304


See https://dev.chromium.org/Home/chromium-security/bugs/reproducing-clusterfuzz-bugs for more information.

If you suspect that the result above is incorrect, try re-doing that job on the test case report page.

Sign in to add a comment