-
Notifications
You must be signed in to change notification settings - Fork 10k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TypeError: Cannot read properties of undefined (reading 'samplesPerLine') #17302
Comments
Hi @Snuffleupagus would be interested in fuzzing pdf.js at oss-fuzz ? It's a free service by google for continuously fuzzing important open source projects. |
Thanks for the offer! For example: A lot of the worker-thread code, which is where the parsing happens, will be called with data that's already been validated elsewhere; hence I'd be slightly worried about us potentially "drowning" in unrelated/non-actionable reports.[1] /cc @calixteman, @marco-c What's your opinion on this? [1] Note that the patch for this issue simply "replaced" an implicit Error with an explicit one, see the discussion starting at #17303 (review). |
@Snuffleupagus can you point me to where in the worker-thread code this validation occurs? Assuming that that code is exported, the fuzzer implementation could pass data through that validation routing before then passing it to the individual parsers (which I definitely think is a worthwhile fuzzing target). |
There's no "point" where that happens, since we have lots of validation all over the place (which you need given how real-world PDF documents often look). |
That is a valid concern but it's better to see what bugs are found and triage as time allows. Invalid issues can always be marked as |
Hi thanks for your feedback, jazzer.js(libfuzzer) catches such reports fairly early that's how it did for above report, After the fix and seeing it running for sometime i have not seen such issue being raised. The reason for selecting ImageDecoders was, as it being listed as an example and it seems its also being released seperately as pdfjs-dist. In short we can fine tune fuzzing code(the one calling parse in this case) to ignore such errors. Should we start with decoders for now to see how it goes, i can submit a pr as an initial step. |
Note that when the image decoders are used "normally", i.e. during parsing of a PDF document, any errors thrown during image decoding will be caught and thus cannot break general parsing of a PDF page.
We should probably wait for feedback from @calixteman and @marco-c first, before doing something that might add a lot of maintenance/triaging work. |
@manunio if you are willing to work on the integration and on an initial triage of the problems found, we could make a try. You can file a single issue (so that it doesn't pollute the repo too much) with a list of problems found that you think are relevant, and we can triage as time allows. |
Yes, I'm happy to help whenever I can, but to meet oss-fuzz's requirement for project acceptance, they ask for email(s) addresses from your end. This helps ensure that project maintainers get bug reports effectively. Note the email(s) affiliated with the project will be public in the OSS-Fuzz repo, as they will be part of a configuration file. |
I think before adding ourselves to OSS-Fuzz we should first try a bit manually, otherwise we will be overwhelmed by automatically filed issues. |
That's what I did locally, I keep it running for a few hours to check early crashes, this issue was its initial finding and have not found anything yet. Please note that oss-fuzz will not file github issues unless specifically stated in it's config file but you will receive the mail though. Another alternative will be ClusterFuzzLite its based on Clusterfuzz which powers oss-fuzz, it runs as a part of CI workflow. |
Let's go ahead then, you can add my email (mcastelluccio@mozilla.com). |
While Fuzzing locally using jazzer.js
JpegImage().parse
threwTypeError: Cannot read properties of undefined (reading 'samplesPerLine')
atpdf.js/src/core/jpg.js
Line 1076 in d8424a4
Configuration:
Steps to reproduce the problem:
What is the expected behavior?
The text was updated successfully, but these errors were encountered: