javascript - Is calling a method of `unsafeWindow` in GM script with privileges a vulnerable practice? -
i have script like
// ==userscript== // @grant gm_getvalue // @grant gm_setvalue // @include * // @run-at document-start // ==/userscript== var foo = gm_getvalue('foo'); var _open = unsafewindow.open; unsafewindow.open = function(){ if( /* */ ){ _open(); } settimeout(function() { gm_setvalue('bar', 'bar'); }, 0); }
maybe malicious site could
- add getter
window.open
execute malicious code whenvar _open = unsafewindow.open
- add setter
window.open
execute malicious code whenunsafewindow.open = /*...*/
- replace
window.open
malicious function, execute when use_open()
could way malicious site gain privileges use gm_getvalue
or gm_setvalue
, or variables defined in script (like foo
)?
Comments
Post a Comment