New issue
Advanced search Search tips

Issue 635046 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner:
Closed: Feb 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux
Pri: 2
Type: Bug-Security



Sign in to add a comment

Use-of-uninitialized-value in CRYPT_ArcFourSetup

Project Member Reported by ClusterFuzz, Aug 5 2016

Issue description

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

Fuzzer: libfuzzer_pdfium_fuzzer
Job Type: libfuzzer_chrome_msan
Platform Id: linux

Crash Type: Use-of-uninitialized-value
Crash Address: 
Crash State:
  CRYPT_ArcFourSetup
  CRYPT_ArcFourCryptBlock
  CPDF_SecurityHandler::CheckUserPassword
  
Recommended Security Severity: Medium

Regressed: https://cluster-fuzz.appspot.com/revisions?job=libfuzzer_chrome_msan&range=395689:395794

Minimized Testcase (0.67 Kb): https://cluster-fuzz.appspot.com/download/AMIfv94h2WBLvLEdIqEegfw1Ew25ThkuckvdvzRYsLkpjPe-VDUD6FK04FcXHMdjWNYM93vlhH-S3-VnFuIFP86g1H4opHYZ6ESoeU-bFXztSl7sQUH5CsCYqLJjl2pcftGIN2g5ewxsFZ8XxX9rkOKrMmD1XfREBQ?testcase_id=4958327648026624

Issue manually filed by: mbarbella

See https://chromium.googlesource.com/chromium/src/+/master/testing/libfuzzer/reproducing.md for more information.
 
Cc: thestig@chromium.org
Components: Internals>Plugins>PDF
Labels: Pri-1
Owner: tsepez@chromium.org
Status: Assigned (was: Untriaged)
tsepez: could you please take a look? Thanks!
Project Member

Comment 2 by sheriffbot@chromium.org, Aug 6 2016

Labels: M-53
Project Member

Comment 3 by sheriffbot@chromium.org, Aug 6 2016

Labels: ReleaseBlock-Stable
Labels: -Security_Severity-Medium -Security_Impact-Beta Security_Impact-Stable Security_Severity-Low
https://cs.chromium.org/chromium/src/third_party/pdfium/core/fpdfapi/fpdf_parser/cpdf_security_handler.cpp?rcl=0&l=152 

keylen is set to zero (length from dict was 1).

  } else {
    keylen = Version > 1 ? pEncryptDict->GetIntegerBy("Length", 40) / 8 : 5;
  }
  if (keylen > 32 || keylen < 0) {
    return FALSE;
  }
  return TRUE;
}

Not sure if the check wanted to be <= 0 above, but a zero-length key seems like a legit possiblity.  The code is also probably wrong if we don't have a multiple of 8 bits.

Later on, CRYPT_ArcFourSetup assumes it has at least one byte of key

   j = (j + a + key[k]) & 0xFF;
 
Not sure if we care to fix this other than to avoid the warning, its a single byte that gets mixed in and whose value is unlikely to be of use as an infoleak.
Labels: -ReleaseBlock-Stable
Cc: dsinclair@chromium.org
The PDF spec indicates that the length value must be a multiple of 8, in the range 40 to 128. Default value: 40.  So the question is whether to enforce this, and risk breaking non-conforming documents in the wild ...

@dsinclair, @thestig, any opinion?
Cc: tsepez@chromium.org
Owner: dsinclair@chromium.org
Over to Dan for resolution.
Do we know of any PDFs which break this assumption that aren't mal-formed? My vote would be that we fix it to follow the spec and if we get non-comforming PDFs we can update to make them work if they're valid.
Project Member

Comment 9 by sheriffbot@chromium.org, Aug 9 2016

Labels: -Pri-1 Pri-2
Project Member

Comment 10 by sheriffbot@chromium.org, Oct 13 2016

Labels: -M-53 M-54
Project Member

Comment 11 by sheriffbot@chromium.org, Dec 2 2016

Labels: -M-54 M-55
Project Member

Comment 12 by sheriffbot@chromium.org, Jan 26 2017

Labels: -M-55 M-56
Project Member

Comment 13 by ClusterFuzz, Feb 25 2017

Status: WontFix (was: Assigned)
ClusterFuzz testcase 4958327648026624 is flaky and no longer reproduces, so closing issue.

If this is incorrect, please add ClusterFuzz-Wrong label and re-open the issue.
Uh, looks like this got refiled as  bug 686128 ?
Project Member

Comment 15 by sheriffbot@chromium.org, Jun 4 2017

Labels: -Restrict-View-SecurityTeam 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