New issue
Advanced search Search tips

Issue 714074 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Apr 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux
Pri: 1
Type: Bug-Security



Sign in to add a comment

Use-of-uninitialized-value in CPDF_PatchDrawer::Draw

Project Member Reported by ClusterFuzz, Apr 21 2017

Issue description

Project Member

Comment 1 by sheriffbot@chromium.org, Apr 21 2017

Labels: M-59
Project Member

Comment 2 by sheriffbot@chromium.org, Apr 21 2017

Labels: ReleaseBlock-Beta
This issue is a security regression. If you are not able to fix this quickly, please revert the change that introduced it.

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

Comment 3 by sheriffbot@chromium.org, Apr 21 2017

Labels: Pri-1
Cc: dsinclair@chromium.org
Components: Internals>Plugins>PDF
CPDF_MeshStream::ReadColor() doesn't check the result of the GetRGB function before returning and doesn't initialize the values passed into GetRGB. It appears that most implementations will set values unconditionally, but at least one doesn't:

bool CPDF_IndexedCS::GetRGB(float* pBuf, float* R, float* G, float* B) const {
  int index = static_cast<int32_t>(*pBuf);
  if (index < 0 || index > m_MaxIndex)
    return false;

Comment 5 by mea...@chromium.org, Apr 21 2017

Cc: -dsinclair@chromium.org
Owner: dsinclair@chromium.org
Status: Assigned (was: Untriaged)
https://pdfium.googlesource.com/pdfium/+/940f559b985d4a742c21b21cb077a232e44dd289 is in the regression range and has changed CPDF_MeshStream::ReadColor().

dsinclair: Assigning to you as the author of that CL.
Project Member

Comment 6 by sheriffbot@chromium.org, Apr 22 2017

Labels: -Security_Impact-Head Security_Impact-Beta
Status: Started (was: Assigned)
https://pdfium-review.googlesource.com/c/4450/
Project Member

Comment 8 by bugdroid1@chromium.org, Apr 24 2017

The following revision refers to this bug:
  https://pdfium.googlesource.com/pdfium/+/302cd78d00c280cb212a5934a7a8293851e9650c

commit 302cd78d00c280cb212a5934a7a8293851e9650c
Author: Dan Sinclair <dsinclair@chromium.org>
Date: Mon Apr 24 18:22:24 2017

Initialize colour values

The colour values returned from the ColorSpace GetRBG methods may not
have set a value. This CL updates the CPDF_MeshStream to always
initialize the values to 0 so they can't be used uninitialized.

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

[modify] https://crrev.com/302cd78d00c280cb212a5934a7a8293851e9650c/core/fpdfapi/page/cpdf_meshstream.cpp

Status: Fixed (was: Started)
dsinclair: Thank you for the quick fix!
Project Member

Comment 11 by ClusterFuzz, Apr 25 2017

ClusterFuzz has detected this issue as fixed in range 466717:466737.

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

Fuzzer: ifratric_pdf_generic
Job Type: linux_msan_pdfium
Platform Id: linux

Crash Type: Use-of-uninitialized-value
Crash Address: 
Crash State:
  CPDF_PatchDrawer::Draw
  CPDF_RenderStatus::DrawShading
  CPDF_RenderStatus::ProcessShading
  
Sanitizer: memory (MSAN)

Recommended Security Severity: Medium

Regressed: https://clusterfuzz.com/revisions?job=linux_msan_pdfium&range=450401:450485
Fixed: https://clusterfuzz.com/revisions?job=linux_msan_pdfium&range=466717:466737

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


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

Comment 12 by sheriffbot@chromium.org, Apr 25 2017

Labels: -Restrict-View-SecurityTeam Restrict-View-SecurityNotify
Labels: Merge-Request-59
Project Member

Comment 14 by sheriffbot@chromium.org, Apr 26 2017

Labels: -Merge-Request-59 Hotlist-Merge-Approved Merge-Approved-59
Your change meets the bar and is auto-approved for M59. Please go ahead and merge the CL to branch 3071 manually. Please contact milestone owner if you have questions.
Owners: amineer@(Android), cmasso@(iOS), gkihumba@(ChromeOS), Abdul Syed@(Desktop)

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

Comment 15 by bugdroid1@chromium.org, Apr 26 2017

Labels: -merge-approved-59 merge-merged-3071
The following revision refers to this bug:
  https://pdfium.googlesource.com/pdfium/+/640ce01e14c2e9b7b4ee3928988ff82eb230620e

commit 640ce01e14c2e9b7b4ee3928988ff82eb230620e
Author: Dan Sinclair <dsinclair@chromium.org>
Date: Wed Apr 26 13:32:34 2017

[Merge M59] Initialize colour values

The colour values returned from the ColorSpace GetRBG methods may not
have set a value. This CL updates the CPDF_MeshStream to always
initialize the values to 0 so they can't be used uninitialized.

TBR=tsepez@chromium.org
Bug:  chromium:714074 
Change-Id: Id2db5eabe31d2ff19f9330b2bc5c681680cf461d
Reviewed-on: https://pdfium-review.googlesource.com/4450
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
(cherry picked from commit 302cd78d00c280cb212a5934a7a8293851e9650c)

Change-Id: Ieaa639ed65c0ff8e654d6559818c32ff770d49d7
Reviewed-on: https://pdfium-review.googlesource.com/4530
Reviewed-by: dsinclair <dsinclair@chromium.org>

[modify] https://crrev.com/640ce01e14c2e9b7b4ee3928988ff82eb230620e/core/fpdfapi/page/cpdf_meshstream.cpp

Labels: -ReleaseBlock-Beta -Hotlist-Merge-Approved
Project Member

Comment 17 by sheriffbot@chromium.org, Aug 1 2017

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