Skip to content
This repository was archived by the owner on Mar 10, 2026. It is now read-only.
This repository was archived by the owner on Mar 10, 2026. It is now read-only.

rastertopwg: heap buffer overflow #4598

Closed

Description

@michaelrsweet

Version: 2.0-current
CUPS.org User: pdewacht

In the rastertopwg filter, a malformed raster file can cause the filter to allocate a line buffer that's smaller than cupsBytesPerLine. As a result, cupsRasterReadPixels will write beyond the end of this buffer. A sample file is attached.

This can be remotely triggered on a print server that shares a printer that uses the rastertopwg filter.

Found using afl-fuzz.

Activity

  1. michaelrsweet commented on Mar 25, 2015

    @michaelrsweet
    ContributorAuthor

    CUPS.org User: mike

    Fixed in Subversion repository.

  2. michaelrsweet commented on Mar 25, 2015

    @michaelrsweet
    ContributorAuthor

    "str4598.patch":

    Index: filter/rastertopwg.c

    --- filter/rastertopwg.c (revision 12567)
    +++ filter/rastertopwg.c (working copy)
    @@ -3,7 +3,7 @@
    *

    • CUPS raster to PWG raster format filter for CUPS.
      *

      • * Copyright 2011, 2014 Apple Inc.
      • * Copyright 2011, 2014-2015 Apple Inc.
        *
    • These coded instructions, statements, and computer programs are the

    • property of Apple Inc. and are protected by Federal copyright law.
      @@ -401,6 +401,9 @@

      • Copy raster data...
        */
    • if (linesize < inheader.cupsBytesPerLine)

    •  linesize = inheader.cupsBytesPerLine;
      

      line = malloc(linesize);

      memset(line, white, linesize);

  3. added this to the Stable milestone on Mar 17, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions