Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rastertopwg: heap buffer overflow #4598

Closed
michaelrsweet opened this issue Mar 1, 2015 · 2 comments
Closed

rastertopwg: heap buffer overflow #4598

michaelrsweet opened this issue Mar 1, 2015 · 2 comments
Milestone

Comments

@michaelrsweet
Copy link
Collaborator

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.

@michaelrsweet
Copy link
Collaborator Author

CUPS.org User: mike

Fixed in Subversion repository.

@michaelrsweet
Copy link
Collaborator Author

"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);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant