New issue
Advanced search Search tips

Issue 675236 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Jan 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux
Pri: 2
Type: Bug



Sign in to add a comment

Integer-overflow in CJBig2_HuffmanTable::ParseFromCodedBuffer

Project Member Reported by ClusterFuzz, Dec 16 2016

Issue description

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

Fuzzer: libfuzzer_pdf_codec_jbig2_fuzzer
Job Type: libfuzzer_chrome_ubsan
Platform Id: linux

Crash Type: Integer-overflow
Crash Address: 
Crash State:
  CJBig2_HuffmanTable::ParseFromCodedBuffer
  CJBig2_HuffmanTable::CJBig2_HuffmanTable
  CJBig2_Context::parseTable
  
Regressed: https://cluster-fuzz.appspot.com/revisions?job=libfuzzer_chrome_ubsan&range=421422:421461

Minimized Testcase (0.07 Kb): https://cluster-fuzz.appspot.com/download/AMIfv97BBR5HIhHtPlTpsdyCEn5e5htLIh8ILpskdMVpy8LXhpeJkLBVJhdIRwCzlVSEfLp0M1CQe75X2-8lNWe-XkTQNQtOzwW14f0UeqJcPovL2W8h4MW8h04djsc4g7eOrWZNVmlqlEfDZxYoHJXbHqDs4ljrFA?testcase_id=4715965922410496

Issue filed automatically.

See https://chromium.googlesource.com/chromium/src/+/master/testing/libfuzzer/reproducing.md for more information.
 
Cc: kcwu@chromium.org
Components: Internals>Plugins>PDF
Labels: Test-Predator-Wrong M-56
Owner: dsinclair@chromium.org
Status: Assigned (was: Untriaged)
Git blame below is NOT necessarily who introduced the crash nor the owner for it. Please check the code before assigning to anyone.(No CL in the regression range changed the crashing files.) 

Author: Dan Sinclair
Project: chromium-pdfium
Changelist: https://pdfium.googlesource.com/pdfium.git/+/764ec513eecbebd12781bcc96ce81ed5e736ee92
Time: Mon Mar 14 13:35:12 2016 -0400
The CL last changed line 72 of file JBig2_HuffmanTable.cpp, which is stack frame 0. 

Author: Dan Sinclair
Project: chromium-pdfium
Changelist: https://pdfium.googlesource.com/pdfium.git/+/764ec513eecbebd12781bcc96ce81ed5e736ee92
Time: Mon Mar 14 13:35:12 2016 -0400
The CL last changed line 26 of file JBig2_HuffmanTable.cpp, which is stack frame 1. 

Author: Dan Sinclair
Project: chromium-pdfium
Changelist: https://pdfium.googlesource.com/pdfium.git/+/764ec513eecbebd12781bcc96ce81ed5e736ee92
Time: Mon Mar 14 13:35:12 2016 -0400
The CL last changed line 1234 of file JBig2_Context.cpp, which is stack frame 2. 

Author: Dan Sinclair
Project: chromium-pdfium
Changelist: https://pdfium.googlesource.com/pdfium.git/+/764ec513eecbebd12781bcc96ce81ed5e736ee92
Time: Mon Mar 14 13:35:12 2016 -0400
The CL last changed line 329 of file JBig2_Context.cpp, which is stack frame 3. 

Author: Dan Sinclair
Project: chromium-pdfium
Changelist: https://pdfium.googlesource.com/pdfium.git/+/764ec513eecbebd12781bcc96ce81ed5e736ee92
Time: Mon Mar 14 13:35:12 2016 -0400
The CL last changed line 87 of file JBig2_Context.cpp, which is stack frame 4. 

Author: Dan Sinclair
Project: chromium-pdfium
Changelist: https://pdfium.googlesource.com/pdfium.git/+/764ec513eecbebd12781bcc96ce81ed5e736ee92
Time: Mon Mar 14 13:35:12 2016 -0400
The CL last changed line 190 of file JBig2_Context.cpp, which is stack frame 5. 

Author: Dan Sinclair
Project: chromium-pdfium
Changelist: https://pdfium.googlesource.com/pdfium.git/+/764ec513eecbebd12781bcc96ce81ed5e736ee92
Time: Mon Mar 14 13:35:12 2016 -0400
The CL last changed line 183 of file JBig2_Context.cpp, which is stack frame 6.

dsinclair@, could you please take a look and help us to find correct owner if it is not related your changes.
Status: Started (was: Assigned)
https://pdfium-review.googlesource.com/c/2131/
Project Member

Comment 3 by bugdroid1@chromium.org, Jan 3 2017

The following revision refers to this bug:
  https://pdfium.googlesource.com/pdfium.git/+/5e3b976529f18deb389ed608da88b895eb115d72

commit 5e3b976529f18deb389ed608da88b895eb115d72
Author: Dan Sinclair <dsinclair@chromium.org>
Date: Tue Jan 03 19:57:14 2017

Check for overflow in JBig2 Huffman decoder

This CL updates the Huffman decoder in the JBig2 codex to check the low field
does not overflow.

BUG= chromium:675236 

Change-Id: I7f5f6fe8329df4ece6f317fac521fe2373686479
Reviewed-on: https://pdfium-review.googlesource.com/2131
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>

[modify] https://crrev.com/5e3b976529f18deb389ed608da88b895eb115d72/core/fxcodec/jbig2/JBig2_HuffmanTable.cpp

Status: Fixed (was: Started)
Project Member

Comment 5 by bugdroid1@chromium.org, Jan 3 2017

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

commit ccc0a0df672069b9f803920d080a2e685220b0b0
Author: pdfium-deps-roller <pdfium-deps-roller@chromium.org>
Date: Tue Jan 03 23:20:04 2017

Roll src/third_party/pdfium/ fa07af3e9..72f50f202 (5 commits).

https://pdfium.googlesource.com/pdfium.git/+log/fa07af3e9b8f..72f50f2021cd

$ git log fa07af3e9..72f50f202 --date=short --no-merges --format='%ad %ae %s'
2017-01-03 dsinclair Cleanup ThemeProvider code
2017-01-03 dsinclair Remove the ::GetCapacity methods.
2017-01-03 dsinclair Create individual exception methods.
2017-01-03 dsinclair Convert CFWL_MonthCalendar to use return values
2017-01-03 dsinclair Check for overflow in JBig2 Huffman decoder

BUG= 675236 

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+/master/autoroll/README.md

If the roll is causing failures, see:
http://www.chromium.org/developers/tree-sheriffs/sheriff-details-chromium#TOC-Failures-due-to-DEPS-rolls

TBR=dsinclair@chromium.org

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

[modify] https://crrev.com/ccc0a0df672069b9f803920d080a2e685220b0b0/DEPS

Project Member

Comment 6 by ClusterFuzz, Jan 4 2017

ClusterFuzz has detected this issue as fixed in range 441189:441247.

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

Fuzzer: libfuzzer_pdf_codec_jbig2_fuzzer
Job Type: libfuzzer_chrome_ubsan
Platform Id: linux

Crash Type: Integer-overflow
Crash Address: 
Crash State:
  CJBig2_HuffmanTable::ParseFromCodedBuffer
  CJBig2_HuffmanTable::CJBig2_HuffmanTable
  CJBig2_Context::parseTable
  
Regressed: https://cluster-fuzz.appspot.com/revisions?job=libfuzzer_chrome_ubsan&range=421422:421461
Fixed: https://cluster-fuzz.appspot.com/revisions?job=libfuzzer_chrome_ubsan&range=441189:441247

Minimized Testcase (0.07 Kb): https://cluster-fuzz.appspot.com/download/AMIfv97BBR5HIhHtPlTpsdyCEn5e5htLIh8ILpskdMVpy8LXhpeJkLBVJhdIRwCzlVSEfLp0M1CQe75X2-8lNWe-XkTQNQtOzwW14f0UeqJcPovL2W8h4MW8h04djsc4g7eOrWZNVmlqlEfDZxYoHJXbHqDs4ljrFA?testcase_id=4715965922410496

See https://chromium.googlesource.com/chromium/src/+/master/testing/libfuzzer/reproducing.md 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