Fix heap buffer overflow in decode_png#7691
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/vision/7691
Note: Links to docs will display an error until the docs builds have been completed. ❌ 1 New Failure, 2 Unrelated FailuresAs of commit 8cbf5d7: BROKEN TRUNK - The following jobs failed but were present on the merge base 5178a2e:👉 Rebase onto the `viable/strict` branch to avoid these failures
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
Hi @kobrineli! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks! |
decode_pngdecode_png
NicolasHug
left a comment
There was a problem hiding this comment.
Thanks for the PR @kobrineli , LGTM if green. We'll need you to sign the CLA before we can merge it.
@vfdev-5 maybe you want to give this a quick look?
|
@NicolasHug Hi! Thank you |
vfdev-5
left a comment
There was a problem hiding this comment.
looks good to me as well, thanks @kobrineli
|
Hey @NicolasHug! You merged this PR, but no labels were added. The list of valid labels is available at https://github.com/pytorch/vision/blob/main/.github/process_commit.py |
Reviewed By: vmoens Differential Revision: D47186584 fbshipit-source-id: cafbfcdc70b8a7bfe5160b07e671f0141e939aaf
Hi! We've been fuzzing torchvision project with sydr-fuzz.
We've found a heap buffer overflow error at
png.c:90in libpng project.The error occurred because in
decode_png.cppin the first bytes of the input contents are compared with the png signature. But there is no check that the input size can be less than 8, so the heap buffer overflow atpng_sig_cmpfunction may happentorchvision version: 9d0a93e
pytorch version: 0f1621df1a0a73956c7ce4e2f72f069e610e0137
OS: Ubuntu 20.04
How to reproduce
Build docker from here and run the container:
Run the target on this input:
You will see the following output: