New issue
Advanced search Search tips

Issue 867792 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Jul 27
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Android , Windows , iOS , Chrome , Mac
Pri: 1
Type: Bug-Security



Sign in to add a comment

Security: corrupt VP9 frame will cause tab crash

Project Member Reported by jzern@chromium.org, Jul 26

Issue description

VULNERABILITY DETAILS
Original bug: crbug.com/webm/1543

VERSION
Chrome Version: m67- (all current stable-tip of tree)
Operating System: All

REPRODUCTION CASE
Attached. Drop the .crash extension and open with file:///...crbug-webm-1543.webm

FOR CRASHES, PLEASE INCLUDE THE FOLLOWING ADDITIONAL INFORMATION
Type of crash: tab
Crash State:
stacktrace would be similar to:
==14188==    at 0x0: ???
==14188==    by 0x4D8C07: vpx_rb_read_bit (bitreader_buffer.c:26)
==14188==    by 0x4D8C07: vpx_rb_read_literal (bitreader_buffer.c:33)
==14188==    by 0x4B916A: vp9_read_frame_size (vp9_decodeframe.c:2002)
==14188==    by 0x4B8FA8: decoder_peek_si_internal (vp9_dx_iface.c:163)
==14188==    by 0x4B908F: decode_one (vp9_dx_iface.c:283)
==14188==    by 0x4B81B2: decoder_decode (vp9_dx_iface.c:361)
==14188==    by 0x4671EA: vpx_codec_decode (vpx_decoder.c:116)
 
crbug-webm-1543.webm.crash
283 bytes Download
Upstream fix:

commit 0681cff1ad36b3ef8ec242f59b5a6c4234ccfb88
Author: James Zern <jzern@google.com>
Date: Thu Jul 26 00:18:30 2018

vp9: fix OOB read in decoder_peek_si_internal

Profile 1 or 3 bitstreams may require 11 bytes for the header in the
intra-only case.

Additionally add a check on the bit reader's error handler callback to
ensure it's non-NULL before calling to avoid future regressions.

This has existed since at least (pre-1.4.0):
09bf1d61c Changes hdr for profiles > 1 for intraonly frames

BUG=webm:1543

Change-Id: I23901e6e3a219170e8ea9efecc42af0be2e5c378

[modify] https://crrev.com/0681cff1ad36b3ef8ec242f59b5a6c4234ccfb88/vp9/vp9_dx_iface.c
[modify] https://crrev.com/0681cff1ad36b3ef8ec242f59b5a6c4234ccfb88/vpx_dsp/bitreader_buffer.c
[modify] https://crrev.com/0681cff1ad36b3ef8ec242f59b5a6c4234ccfb88/test/decode_api_test.cc
Project Member

Comment 2 by sheriffbot@chromium.org, Jul 26

Status: Assigned (was: Unconfirmed)
Project Member

Comment 3 by ClusterFuzz, Jul 26

ClusterFuzz is analyzing your testcase. Developers can follow the progress at https://clusterfuzz.com/testcase?key=6204574168514560.
Project Member

Comment 4 by ClusterFuzz, Jul 26

Labels: Security_Impact-Stable
Detailed report: https://clusterfuzz.com/testcase?key=6204574168514560

Job Type: linux_asan_chrome_mp
Platform Id: linux

Crash Type: Null-dereference READ
Crash Address: 0x000000000000
Crash State:
  base::CreateThread
  base::Thread::StartWithOptions
  base::Thread::Start
  
Sanitizer: address (ASAN)

Reproducer Testcase: https://clusterfuzz.com/download?testcase_id=6204574168514560

See https://github.com/google/clusterfuzz-tools for more information.
Project Member

Comment 5 by ClusterFuzz, Jul 26

Components: Internals>Core
Labels: Test-Predator-Auto-Components
Automatically applying components based on crash stacktrace and information from OWNERS files.

If this is incorrect, please apply the Test-Predator-Wrong-Components label.
Labels: Security_Severity-Medium
Project Member

Comment 7 by bugdroid1@chromium.org, Jul 27

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

commit a7948e97ce51557236900d95558cc28af6c4c5d6
Author: James Zern <jzern@chromium.org>
Date: Fri Jul 27 00:03:23 2018

Roll src/third_party/libvpx/source/libvpx/ 2c45cd174..3b921d49b (40 commits)

https://chromium.googlesource.com/webm/libvpx.git/+log/2c45cd174a95..3b921d49b07a

$ git log 2c45cd174..3b921d49b --date=short --no-merges --format='%ad %ae %s'
2018-07-25 marpan vp9: Modify condition for force test of intra
2018-07-25 marpan vp9: Avoid early breakout on slide change
2018-07-24 jzern vp9: fix OOB read in decoder_peek_si_internal
2018-07-25 marpan Revert "vp9: Adjust reset segment for real-time screen-content"
2018-07-25 jingning Clean up get_overlap_area function
2018-07-24 jingning Factor out mode estimation process in tpl model build
2018-07-24 yaowu Improve help message for arnr-type
2018-07-24 huisu Fix typos in txfm_rd_in_plane()
2018-07-24 marpan vp9: Modify logic for flat blocks in nonrd-pickmode.
2018-07-24 wtc Check size limit in vpx_realloc_frame_buffer.
2018-07-24 slavarnway VPX: avg_intrin_sse2.c, avg_intrin_avx2.c cleanup
2018-07-24 paulwilkins Limit min Q for normal frames.
2018-07-23 marpan vp9: Adjust reset segment for real-time screen-content
2018-07-23 slavarnway VPX: Improve HBD vpx_hadamard_32x32_avx2()
2018-07-23 jingning Pass in block size for motion search function
2018-07-22 jingning Make the tpl model update operated in 8x8 block unit
2018-07-23 jingning Refactor overlap area computation
2018-07-23 slavarnway VPX: Add vpx_hadamard_32x32_avx2
2018-07-20 huisu Add prune_ref_frame_for_rect_partitions feature
2018-07-22 jingning Map coding block size to transform block size
(...)

Created with:
  roll-dep src/third_party/libvpx/source/libvpx
R=tomfinegan@chromium.org

Bug:  867792 
Change-Id: I196965bee2e278b011cde10ad677b7f69aff0ef1
Reviewed-on: https://chromium-review.googlesource.com/1151052
Reviewed-by: Johann Koenig <johannkoenig@google.com>
Reviewed-by: Tom Finegan <tomfinegan@chromium.org>
Commit-Queue: James Zern <jzern@google.com>
Cr-Commit-Position: refs/heads/master@{#578492}
[modify] https://crrev.com/a7948e97ce51557236900d95558cc28af6c4c5d6/DEPS
[modify] https://crrev.com/a7948e97ce51557236900d95558cc28af6c4c5d6/third_party/libvpx/README.chromium
[modify] https://crrev.com/a7948e97ce51557236900d95558cc28af6c4c5d6/third_party/libvpx/source/config/linux/ia32/vpx_dsp_rtcd.h
[modify] https://crrev.com/a7948e97ce51557236900d95558cc28af6c4c5d6/third_party/libvpx/source/config/linux/x64/vpx_dsp_rtcd.h
[modify] https://crrev.com/a7948e97ce51557236900d95558cc28af6c4c5d6/third_party/libvpx/source/config/mac/ia32/vpx_dsp_rtcd.h
[modify] https://crrev.com/a7948e97ce51557236900d95558cc28af6c4c5d6/third_party/libvpx/source/config/mac/x64/vpx_dsp_rtcd.h
[modify] https://crrev.com/a7948e97ce51557236900d95558cc28af6c4c5d6/third_party/libvpx/source/config/vpx_version.h
[modify] https://crrev.com/a7948e97ce51557236900d95558cc28af6c4c5d6/third_party/libvpx/source/config/win/ia32/vpx_dsp_rtcd.h
[modify] https://crrev.com/a7948e97ce51557236900d95558cc28af6c4c5d6/third_party/libvpx/source/config/win/x64/vpx_dsp_rtcd.h

Project Member

Comment 8 by ClusterFuzz, Jul 27

ClusterFuzz has detected this issue as fixed in range 578489:578493.

Detailed report: https://clusterfuzz.com/testcase?key=6204574168514560

Job Type: linux_asan_chrome_mp
Platform Id: linux

Crash Type: Null-dereference READ
Crash Address: 0x000000000000
Crash State:
  base::CreateThread
  base::Thread::StartWithOptions
  base::Thread::Start
  
Sanitizer: address (ASAN)

Fixed: https://clusterfuzz.com/revisions?job=linux_asan_chrome_mp&range=578489:578493

Reproducer Testcase: https://clusterfuzz.com/download?testcase_id=6204574168514560

See https://github.com/google/clusterfuzz-tools for more information.

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

Comment 9 by ClusterFuzz, Jul 27

Labels: ClusterFuzz-Verified
Status: Verified (was: Assigned)
ClusterFuzz testcase 6204574168514560 is verified as fixed, so closing issue as verified.

If this is incorrect, please add ClusterFuzz-Wrong label and re-open the issue.
Project Member

Comment 10 by sheriffbot@chromium.org, Jul 27

Labels: -Restrict-View-SecurityTeam Restrict-View-SecurityNotify
Labels: Merge-Request-69 ClusterFuzz-Wrong
Status: Started (was: Verified)
Status: Fixed (was: Started)
Project Member

Comment 13 by sheriffbot@chromium.org, Jul 27

Labels: -Merge-Request-69 Merge-Review-69 Hotlist-Merge-Review
This bug requires manual review: DEPS changes referenced in bugdroid comments.
Please contact the milestone owner if you have questions.
Owners: amineer@(Android), kariahda@(iOS), cindyb@(ChromeOS), govind@(Desktop)

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Cc: awhalley@chromium.org
+awhalley@ (Security TPM) for M69 merge review.
The merge will be for an update to DEPS to reference the m69-3497 upstream branch containing a cherry-pick of the fix in comment #1.
Project Member

Comment 16 by sheriffbot@chromium.org, Jul 28

Labels: M-68 Target-68
Labels: -M-68 -Target-68 M-69 Target-69
govind@ - good for 69
Labels: -Merge-Review-69 Merge-Approved-69
Approving merge to M69 branch 3497 based on comment #17. Please merge ASAP. Thank you.
Project Member

Comment 19 by bugdroid1@chromium.org, Jul 30

Labels: -merge-approved-69 merge-merged-3497
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/f0191c3dd6a2090304c7372703c40254212c8688

commit f0191c3dd6a2090304c7372703c40254212c8688
Author: James Zern <jzern@chromium.org>
Date: Mon Jul 30 21:50:37 2018

Roll src/third_party/libvpx/source/libvpx/ 2c45cd174..b0dfe4e5c (1 commit)

https://chromium.googlesource.com/webm/libvpx.git/+log/2c45cd174a95..b0dfe4e5c1dd

$ git log 2c45cd174..b0dfe4e5c --date=short --no-merges --format='%ad %ae %s'
2018-07-24 jzern vp9: fix OOB read in decoder_peek_si_internal

Created with:
  roll-dep src/third_party/libvpx/source/libvpx
R=johannkoenig@chromium.org

Bug:  867792 
Change-Id: I2dbdaf205764a9241f302fe280db6620cf5e7c9e
Reviewed-on: https://chromium-review.googlesource.com/1155738
Reviewed-by: Johann Koenig <johannkoenig@google.com>
Cr-Commit-Position: refs/branch-heads/3497@{#251}
Cr-Branched-From: 271eaf50594eb818c9295dc78d364aea18c82ea8-refs/heads/master@{#576753}
[modify] https://crrev.com/f0191c3dd6a2090304c7372703c40254212c8688/DEPS
[modify] https://crrev.com/f0191c3dd6a2090304c7372703c40254212c8688/third_party/libvpx/README.chromium
[modify] https://crrev.com/f0191c3dd6a2090304c7372703c40254212c8688/third_party/libvpx/source/config/vpx_version.h

Labels: Merge-Request-68
Project Member

Comment 21 by sheriffbot@chromium.org, Jul 31

Labels: -Merge-Request-68 Merge-Review-68
This bug requires manual review: Request affecting a post-stable build
Please contact the milestone owner if you have questions.
Owners: cmasso@(Android), kariahda@(iOS), bhthompson@(ChromeOS), abdulsyed@(Desktop)

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
awhalley@ how critical is this for M68?
jzern, mind adding me to crbug.com/webm/1543 ?
Done (@chromium.org)
Thanks! abdulsyed@: not critical but as an externally reported medium, it's within scope for a speculative merge to stable once it's been in Beta for a while, in case there's another 68 respin (though I know that's unlikely)
Seems like its been in Beta since Thursday. jzern@ how safe is this fix? What are the chances of it introducing new regressions in M68?
No chance for the NULL pointer check. With a valid file the other half of this change won't occur as we don't use this function in chrome to probe partial frame data and a frame of this size would otherwise fail as it would be incomplete.
Labels: -Merge-Review-68 Merge-Rejected-68
Let's target this for M69. 
Labels: Release-0-M69
Project Member

Comment 30 by sheriffbot@chromium.org, Nov 3

Labels: -Restrict-View-SecurityNotify allpublic
This bug has been closed for more than 14 weeks. Removing security view restrictions.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot

Sign in to add a comment