[Poppler-bugs] [Bug 93476] New: Memory Corruption while processing Blend Mode

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Tue Dec 22 11:09:34 PST 2015


https://bugs.freedesktop.org/show_bug.cgi?id=93476

            Bug ID: 93476
           Summary: Memory Corruption while processing Blend Mode
           Product: poppler
           Version: unspecified
          Hardware: x86 (IA32)
                OS: other
            Status: NEW
          Severity: major
          Priority: medium
         Component: general
          Assignee: poppler-bugs at lists.freedesktop.org
          Reporter: Hanafie.Nuruddin at f13-labs.net

Created attachment 120651
  --> https://bugs.freedesktop.org/attachment.cgi?id=120651&action=edit
Test case (PoC, crashdump, stack trace)

Hi,

We found a memory corruption during fuzzing in a different type of PDF reader /
viewer. Upon analysis, we found that bug leads to libpoppler library. The issue
happened when "ExtGState" is not a valid blend mode. We noticed this is related
to security issue. We have attached all the information needed for your
testing.

Our lab test: Ubuntu 14.04.3 LTS (trusty)
PDF viewer / reader: diffpdf, evince, gpdftext, pdf-presenter-console, xpdf,
zathura_viewer, qpdfview


Example testing:

labs at autobot:~/warez/pdf$ qpdfview crash.pdf 
"Error (10431): Invalid blend mode in ExtGState" 
*** Error in `qpdfview': malloc(): memory corruption: 0xb217ca10 ***
Aborted

Code:

GBool Gfx::checkTransparencyGroup(Dict *resDict) {
  // check the effect of compositing objects as a group:
  // look for ExtGState entries with ca != 1 or CA != 1 or BM != normal
  Object extGStates;
  GBool transpGroup = gFalse;
  double opac;

  if (resDict == NULL)
    return gFalse;
  pushResources(resDict);
  resDict->lookup("ExtGState", &extGStates);
  if (extGStates.isDict()) {
    Dict *dict = extGStates.getDict();
    for (int i = 0; i < dict->getLength() && !transpGroup; i++) {
      Object obj1, obj2;
      GfxBlendMode mode;

      if (res->lookupGState(dict->getKey(i), &obj1) && obj1.isDict()) {
        if (!obj1.dictLookup("BM", &obj2)->isNull()) { 
          if (state->parseBlendMode(&obj2, &mode)) { // failed processing blend
mode
            if (mode != gfxBlendNormal)        // true
              transpGroup = gTrue;
          } else {    // 
            error(errSyntaxError, getPos(), "Invalid blend mode in ExtGState");
          }
        }


Thanks!

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/poppler-bugs/attachments/20151222/81c39fff/attachment.html>


More information about the Poppler-bugs mailing list