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

Issue 603545 link

Starred by 1 user

Issue metadata

Status: Verified
Owner:
Closed: May 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux
Pri: 1
Type: Bug



Sign in to add a comment

Integer-overflow in CPDF_SyntaxParser::GetNextChar

Project Member Reported by ClusterFuzz, Apr 14 2016

Issue description

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

Fuzzer: libfuzzer_pdfium_fuzzer
Job Type: libfuzzer_chrome_ubsan
Platform Id: linux

Crash Type: Integer-overflow
Crash Address: 
Crash State:
  CPDF_SyntaxParser::GetNextChar
  CPDF_SyntaxParser::GetNextWordInternal
  GetNextWord
  

Minimized Testcase (0.10 Kb):
Download: https://cluster-fuzz.appspot.com/download/AMIfv96cTGEepHGlZZ7rmSe0ASinm7Ze5iMsSYtIJzkJBxrLl3Z65O9cSiIj_73Gjp5-CVmwUV_V8_7iKEPcuAe13f6e9MrhBGl-Lmx-Kn8_bUxvdVUu2Qhk8gw8mt0iuKD0chm2XjHH6PzU-2ZDAI8n9yrVq10c9w
(oore%PDFrerkdakdc
�%�(
<<startxre/C 0C >0of>bj 
<</�/>[>>startxref 000000000000032895186217325595420% /


Filer: mmoroz

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

Comment 1 by mmoroz@chromium.org, Apr 14 2016

Cc: och...@chromium.org kcc@chromium.org aizatsky@chromium.org
Components: Internals>Plugins>PDF
Cc: tsepez@chromium.org
Project Member

Comment 3 by ClusterFuzz, Jun 27 2016

ClusterFuzz has detected this testcase as flaky and is unable to reproduce it in the original crash revision. Skipping fixed testing check and marking it as potentially fixed.

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

Fuzzer: libfuzzer_pdfium_fuzzer
Job Type: libfuzzer_chrome_ubsan
Platform Id: linux

Crash Type: Integer-overflow
Crash Address: 
Crash State:
  CPDF_SyntaxParser::GetNextChar
  CPDF_SyntaxParser::GetNextWordInternal
  GetNextWord
  

Minimized Testcase (0.07 Kb):
Download: https://cluster-fuzz.appspot.com/download/AMIfv97y2DdMZh-zdNw_NMRV9VZ5pzQq4X75Efzp7gvuU9WGkJDUb8wPqKhDcXGFtXOKlUplNDGxr3aD6gajPdO-iF6RPlMEiyic1TtGY5sj4Av9m45lRk0a2hzM-C7uMnyfeQvj2lNJUnvqUW0VsoQKsvAm-FEABQ?testcase_id=5559691593121792
(oore%PDFrerkdakdc
<</�/>[>>startxref 000000000000032895186217325595420% /


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.
Project Member

Comment 4 by ClusterFuzz, Jul 13 2016

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

Fuzzer: libfuzzer_pdfium_fuzzer
Job Type: libfuzzer_chrome_ubsan
Platform Id: linux

Crash Type: Integer-overflow
Crash Address: 
Crash State:
  CPDF_SyntaxParser::GetNextChar
  CPDF_SyntaxParser::GetNextWordInternal
  GetNextWord
  
Regressed: https://cluster-fuzz.appspot.com/revisions?job=libfuzzer_chrome_ubsan&range=395640:395746

Minimized Testcase (0.07 Kb):
Download: https://cluster-fuzz.appspot.com/download/AMIfv95IAx5oGWi_ezPJHjdzQQuGOXHYBPgc0TGiiMF0pHntyDR5V9gmr9HB2A_Hu9lD_UCve1h4QSXw6ijZYZurJzaRH8n3qQRHpis-7rIfqKtpceFRvQhMWYsAtDWS5m0n32Unp4bxHyfsv8d6H64VXdW-HyuD3g?testcase_id=5694779149254656
%/MITPDF
 %PDF
 L4 /L/4 450%PDF�)startxref
011188180104501881810. P0$%
D


Filer: ajha

See https://chromium.googlesource.com/chromium/src/+/master/testing/libfuzzer/reproducing.md for more information.
Project Member

Comment 5 by sheriffbot@chromium.org, Nov 22 2016

Labels: -Restrict-View-EditIssue
Removing EditIssue view restrictions from ClusterFuzz filed bugs. If you believe that this issue should still be restricted, please reapply the label.

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

Comment 6 by npm@chromium.org, May 3 2017

Owner: npm@chromium.org
Status: Assigned (was: Available)
Project Member

Comment 7 by bugdroid1@chromium.org, May 3 2017

The following revision refers to this bug:
  https://pdfium.googlesource.com/pdfium/+/746babded81e9de3fc132fd670386382c031fa74

commit 746babded81e9de3fc132fd670386382c031fa74
Author: Nicolas Pena <npm@chromium.org>
Date: Wed May 03 16:49:52 2017

SetPos to at most the file length to avoid overflows

This CL prevents arbitrary position setting which may cause integer overflows.
In the bug in question, the PDF says the xrefs are located in a huge position.
This then causes problems when calling CPDF_SyntaxParser methods.

Bug:  chromium:603545 
Change-Id: I5f94c38f46a0217e9f12f1bf8b2f3bee3b03cb35
Reviewed-on: https://pdfium-review.googlesource.com/4813
Commit-Queue: Nicolás Peña <npm@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>

[modify] https://crrev.com/746babded81e9de3fc132fd670386382c031fa74/core/fpdfapi/parser/cpdf_syntax_parser.h
[modify] https://crrev.com/746babded81e9de3fc132fd670386382c031fa74/core/fpdfapi/parser/cpdf_parser.cpp
[modify] https://crrev.com/746babded81e9de3fc132fd670386382c031fa74/core/fpdfapi/parser/cpdf_syntax_parser_unittest.cpp
[modify] https://crrev.com/746babded81e9de3fc132fd670386382c031fa74/core/fpdfapi/parser/cpdf_data_avail.cpp

Project Member

Comment 8 by ClusterFuzz, May 4 2017

ClusterFuzz has detected this issue as fixed in range 469038:469104.

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

Fuzzer: libfuzzer_pdfium_fuzzer
Job Type: libfuzzer_chrome_ubsan
Platform Id: linux

Crash Type: Integer-overflow
Crash Address: 
Crash State:
  CPDF_SyntaxParser::GetNextChar
  CPDF_SyntaxParser::GetNextWordInternal
  CPDF_SyntaxParser::GetKeyword
  
Sanitizer: undefined (UBSAN)

Regressed: https://clusterfuzz.com/revisions?job=libfuzzer_chrome_ubsan&range=395640:395746
Fixed: https://clusterfuzz.com/revisions?job=libfuzzer_chrome_ubsan&range=469038:469104

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


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.
Project Member

Comment 9 by ClusterFuzz, May 4 2017

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

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

Sign in to add a comment