A recent report on Fenix indicated an issue in GeckoView: there is no cap on the size of a data url.
A too big one can cause all kinds of problems in client applications.
A scenario seen in Fenix for this is described in https://github.com/mozilla-mobile/fenix/issues/7341
- Open Fenix.
- Go to: https://www.color-blindness.com/coblis-color-blindness-simulator/ .
- Choose any of the filters to apply, like "Green-Week/Deuteranomaly".
- Tap on the "Browse" button and choose the image you want to change
(pick one having a few MBs in size)
If the "Browse" button is not showing it might overflow the screen. To see it:
- put the device in landscape mode or
- tap on the "3 dots" from bottom right corner -> enable "Desktop Site" option.
- Wait for the image to be processed and the website to show a "Open simulated image in new window"
- Long pressing on the above link will throw an "OutOfMemoryException"
- Pressing on the link will open a new tab but crash with a "TransactionTooLargeException"
Browser session would also get corrupted and so a user would have to clear data / reinstall.
This issue affects Fennec also (though it is more resilient than Fenix and needs a bigger data url to crash),
Chrome and Opera also (which will also be unable to display the result and may get into weird states but do not crash)
I think this issue should be resolved in GeckoView by just capping the url.
Please note that on Android we do have a hard limit of 1MB for all Binder transactions concurrently happening in the process.
Trying to share a big url / pass it to another Android app/service through Intents would also cause a crash.
I think this is another important scenario that would require capping the url in GeckoView.