Repository navigation
Security: bump go-images/jpeg2000 to v0.13.8 — a crafted PDF could crash Page - #120
Merged
Merged
Conversation
Up to jpeg2000 v0.13.7, fourteen bytes of JPEG 2000 -- SOC, then SOT with no SIZ -- divided by zero inside jpeg2000.DecodeConfig. This package calls it to size every JPXDecode image (image.go:889, decodeJPX), and nothing here recovers, so any PDF carrying such an image took down the program that drew it. Witnessed, not inferred: the new test panics at v0.13.7 through Page -> drawImageXObject -> decodeJPX -> DecodeConfig, and passes at v0.13.8, which validates the headers as OpenJPEG does (go-images/jpeg2000#36; found by its FuzzDecode, with two more panics). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
A PDF could crash the program drawing it
Up to jpeg2000 v0.13.7, fourteen bytes of JPEG 2000 made
jpeg2000.DecodeConfigdivide by zero: SOC, then SOT with no SIZ. This package callsDecodeConfigto size everyJPXDecodeimage (image.go:889,decodeJPX). Nothing here recovers, so any PDF carrying such an image takes down the program that renders it.Witnessed, not inferred: the new test
TestACodestreamThatCrashedTheDecoderDoesNotCrashThePagepanics at v0.13.7:It passes at v0.13.8. That release validates the headers as OpenJPEG does (go-images/jpeg2000#36). jpeg2000's new
FuzzDecodefound this panic and two more; all three are fixed.The test stays as a regression test. All tests pass.
🤖 Generated with Claude Code