Reject invalid custom page parameter types - #1665
Open
carrerasdarren-cell wants to merge 1 commit into
Open
Conversation
michaelrsweet
requested changes
Aug 10, 2026
michaelrsweet
left a comment
Member
There was a problem hiding this comment.
I think we can do without the unit test changes (this isn't a common issue and if the PPD loader rejects the file that is sufficient...)
WRT the custom parameter checks, we should also check that WidthOffset and HeightOffset are also points and that Orientation is PPD_CUSTOM_INT.
Custom PageSize processing consumes Width, Height, WidthOffset, and HeightOffset as point values and Orientation as an integer. Reject declarations with incompatible types before those values can be interpreted through the wrong union member. This prevents the disclosed Width string type confusion and applies the same invariant to the related custom page parameters. References: OSV-2026-551
carrerasdarren-cell
force-pushed
the
darren/reject-invalid-custom-page-dimensions
branch
from
August 10, 2026 22:27
3433193 to
46c5a98
Compare
Author
|
Addressed in |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ParamCustomPageSizeWidth, Height, WidthOffset, and HeightOffset declarations unless their type ispointsParamCustomPageSizeOrientation unless its type isintRoot cause
Custom PageSize processing consumes Width, Height, WidthOffset, and HeightOffset through the
custom_pointsunion member and Orientation throughcustom_int. A malformed PPD can declare one of those parameters with an incompatible pointer-backed type. For Width, the disclosed OSS-Fuzz testcase causesppdPageSize()to overwrite the pointer union member with float bits, andppdClose()later passes those bits tofree().Rejecting incompatible types during parsing prevents the union type confusion and applies the same invariant to the related custom page parameters.
Verification
Bad custom parameter, with no AddressSanitizer faultBad custom parameter, with no AddressSanitizer faultpointsparameters and integer Orientation was acceptedcups/testppdfocused suite: all checks passed under AddressSanitizergit diff --checkReferences: OSV-2026-551 / OSS-Fuzz issue 500762221