You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This can cause the scriptlet to trigger a TypeError when an invalid meta refresh URL like "http://foo@" is specified. This uncaught exception prevents subsequent noscript nodes from being processed.
Notice that only the first noscript element has been transformed to a span
POC code for future reference:
<!DOCTYPE html><html><head><title>uBO - invalid meta refresh URL</title><metahttp-equiv="Content-Type" content="text/html; charset=UTF-8"/></head><body><noscript><p>Node a should be visible</p></noscript><noscript><metahttp-equiv="refresh" content="15;url=https://foo@"></noscript><noscript><p>Node b should also be visible</p></noscript></body></html>
Expected behavior
All noscript nodes should be processed.
Actual behavior
Only the first noscript node is fully processed due to an uncaught TypeError:
Uncaught TypeError: Failed to construct 'URL': Invalid URL
at autoRefresh (noscript-spoof.js:45)
at noscript-spoof.js:77
at noscript-spoof.js:81
uBlock Origin version
1.37.2
Browser name and version
Firefox 90.0.2, Chrome 92.0.4515.107
Operating System and version
Arch Linux
The text was updated successfully, but these errors were encountered:
Prerequisites
I tried to reproduce the issue when...
Description
The noscript-spoof scriptlet passes meta refresh URLs to the URL constructor without any exception handling:
https://github.com/gorhill/uBlock/blob/1.37.3b2/src/js/scriptlets/noscript-spoof.js#L45
This can cause the scriptlet to trigger a TypeError when an invalid meta refresh URL like "http://foo@" is specified. This uncaught exception prevents subsequent noscript nodes from being processed.
Proposed patch: vtriolet/uBlock@2b9aba2
A specific URL where the issue occurs
https://vtriolet.netlify.app/demos/ubo-invalid_meta_refresh_url.html
Steps to Reproduce
POC code for future reference:
Expected behavior
All noscript nodes should be processed.
Actual behavior
Only the first noscript node is fully processed due to an uncaught TypeError:
uBlock Origin version
1.37.2
Browser name and version
Firefox 90.0.2, Chrome 92.0.4515.107
Operating System and version
Arch Linux
The text was updated successfully, but these errors were encountered: