Indeed, semicolons are not needed, I just tested the same tag with semicolons on FF5 and Chrome last, they both send warnings with this
<img src=x onerror=;;alert('XSS') /> <img src=x onerror=alert('XSS') /> <img src="x" onerror="alert('XSS')" />
I think they are trying to stop the onerror event at the first semicolon, and then output the dummy code from the event in the warning
I tried this
<img src=x onerror=alert('eventfire');;alert('XSS') />
and it includes both warnings inside the event, so it does not fire a second warning outside the event scope.
answer? seems to do the same without semicolons (maybe for older browsers that do not parse html well and trigger a warning outside the scope of the event?)
source share