jpeg-js/jpeg-js

bug: infinite loop/memory leak

yevgenypats opened this issue · 4 comments

Hey there, found the following bug/infinite loop/oom that can be reproduced with the following code:

const jpeg = require('jpeg-js');
jpeg.decode(Buffer.from('ffd8ffc09dfdb0ffff0e5296bd7fbbc4f9579096bd7fbbfc0e80d50000ffff36fa400100236701bf73ffaf8003a57f097f5e000000008023c4f9579096bd7fbb008000001500b34e8c018fda5212', 'hex'))

found using jsfuzz

@yevgenypats Do you know any more about the specifics of this bug? Is there any more detail you can give about how you used jsfuzz to find it, what you were looking for, what jsfuzz did to find it etc. No worries if these details are not available, it's useful to know of the bug. Thanks for reporting it.

@patrickhulce 'not really going to try to close all of these holes' from the PR. How about assisting with the creation of new algorithms that don't have these bugs, either in a new branch of this project, or directing people to the project I'm working on (or at least allowing me to talk about it within jpeg-js discussions). jpeg-js is well known and strong through the network effect, and longer term I see a route where with your support jpeg-js can improve.

this has been fixed by #54