so what about returning window from a function and then use [] on the returned value ? It can be done with an anonymous function :) Of course we still have to split the alert word. Here is the final payload
Фокусировка: focus/blur. Элемент получает фокус, когда пользователь кликает по нему или использует клавишу Tab. Также существует HTML-атрибут autofocus, который устанавливает фокус на элемент, когда страница загружается.
contact[email] onfocus=javascript:alert('xss') autofocus a=a&form_type[a]aaa. The pair "Key","Value" will be echoed back like this
Для этого можно написать небольшой скрипт, который автоматом заменит стиль всех стандартных alert-ов на вашем сайте. Таким образом, на всех браузерах всплывайки будут показываться в тон вашего сайта и с общим стилем. Звучит неплохо.
An element receives the focus when the user either clicks on it or uses the Tab key on the keyboard. There’s also an autofocus HTML attribute that puts the focus onto an element by default when a page loads and other means of getting the focus.
Cross-site scripting works by manipulating a vulnerable web site so that it returns malicious JavaScript to users. When the malicious code executes inside a victim’s browser, the attacker can fully compromise their interaction with the application.
Кстати, когда окно закроется, то typeof window.document покажет «unknown». Нашел еще одну интересную особенность: eval не существует, пока его один раз не упомянешь. Поэтому у меня в коде можно встретить вот такую строчку
Steps to reproduce. Add an input with autoFocus prop in a modal. In the example the modal is opened directly and you can check that the input doesn't have the focus.
Затем функция doCalcAvg () производит вычисления и использует оператор return для возвращения результата (сохраняемого в переменной с именем ans). На рис. 8.13 и 8.14 приводятся схема и результат выполнения функций.