Repository navigation
Conversation
Member
|
[master bea4185] Fix debug printfs. |
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.
Follow-up to #196 and #202.
While reviewing similar diagnostic code, I found two remaining out-of-bounds accesses in builds configured with
--enable-debug.In
cupsJWTHasValidSignature(), the debug log unconditionally reads the first and last four signature bytes. Importing the compact JWS below, whose decoded signature is one byte, and then callingcupsJWTHasValidSignature()produces a heap-buffer-overflow under AddressSanitizer:In the OpenSSL implementation of
cupsSignCredentialsRequest(), the debug extension dump writes two hexadecimal characters per DER byte intotemp[1024]without limiting the extension length. A certificate request containing 30subjectAltNamevalues produces a stack-buffer-overflow under AddressSanitizer. The corresponding 32-byte JWS signature and two-name certificate request controls were clean in the same build.Only emit the detailed first/last signature dump when both four-byte windows fit without overlap, and stop the extension dump before the next formatted byte would exceed the buffer. These paths are compiled out of normal release builds; the changes only bound diagnostic output and do not alter JWT verification or certificate processing.
Assisted-by: OpenAI Codex