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.openexecute malicious code whenvar _open = unsafewindow.open - add setter
window.openexecute malicious code whenunsafewindow.open = /*...*/ - replace
window.openmalicious 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