Follow

recently seen in some JS code

for(var i=0;i<1/0;i++)

what the HELL

@danielhglus i<Infinity? why not just for(var i=0;;i++)?

@ben hmm, on further reading it looks like the idea is to infinite-loop the browser?

for(var i=0;i<1/0;i++)document.location.href="#",window.history.back(),window.history.forward();

gotta say, this is some weird stuff

@danielhglus hmm

seems like a denial of service exploit

also if there are no braces in that it'll never get to the window.history command

@ben look closer - commas, lol

what a bizarrely written snippet

and it's actually in some code to handle user input

@danielhglus seems like it'd just spam the browser history forever

Sign in to participate in the conversation
Mastodon for Tech Folks

This Mastodon instance is for people interested in technology. Discussions aren't limited to technology, because tech folks shouldn't be limited to technology either! We adhere to an adapted version of the TootCat Code of Conduct and have documented a list of blocked instances. Ash is the admin and is supported by Fuzzface, Brian!, and Daniel Glus as moderators. Hosting costs are largely covered by our generous supporters on Patreon – thanks for all the help!