Images are corrupted on upload
Summary
Images uploaded through Tor become an indecipherable series of lines.
Steps to reproduce:
- Use Tor to go to https://codepen.io/mseche/pen/oOVXLg
- Upload any image, jpg, png, webp.
- Observe how the displayed image is a bunch of lines instead of the known good image.
What is the current bug behavior?
Known good images of various formats are made into images of lines.
The same image can sometimes be corrupted and sometimes not be corrupted.
All popular image types are susceptible.
What is the expected behavior?
Image is uploaded and displayed intact.
Environment
- Tor 13.0.5
- Manjaro w/ kernel 6.6.1
- Installed from tarball.
Relevant logs and/or screenshots
This bug has existed for at least 2 years: https://old.reddit.com/r/firefox/comments/pjljai/uploaded_image_gets_corruptedglitched/
THIS IS AN UPSTREAM BUG. Waterfox also has the problem: https://old.reddit.com/r/waterfox/comments/1743518/some_images_are_corrupted/
Possible fixes
Users report that privacy.resistfingerprinting is to blame.
If true, then likely nsRFPService::RandomizePixels is being called on creation of an image in a canvas.
Are these lines what the output of RandomizePixels should look like?
It is not an upload/server side issue, as the codepen demonstrates (the image is only drawn back from memory).