Considering this post (an answer): scrollTop()
jQuery not working
I couldn't see the Run Snippet button. Any reason?
1 Answer 1
After some digging, this is not a bug. The Stack Snippet is explicitly disabled when the post reaches a score of -3 or lower (i.e. when the post is greyed out), which is the case here.
Quoting Haney from this comment and this one also:
Fixed this by disabling heavily downvoted Snippets, which also gives users control over disabling malicious snippets.
it might be "overkill" but it adds a layer of user-controlled security. Snippet is malicious? Downvote it and it becomes un-runnable. Best option we could come up with after discussions.
This was tested in this Meta answer on the Stack Snippet sandbox.
-
9Are malicious snippets frequent/ever occurring?Matsmath– Matsmath2016年08月07日 10:29:18 +00:00Commented Aug 7, 2016 at 10:29
-
@Matsmath I haven't heard of any. Since the JavaScript code in snippets is executed in other domain than Stack Overflow, it's not possible to exploit it for XSS. A snippet could be malicious only if it was exploiting a browser bug.Michał Perłakowski– Michał Perłakowski2016年08月07日 18:17:17 +00:00Commented Aug 7, 2016 at 18:17
-
15@Gothdo It's possible to be malicious without exploiting something. When the snippet feature was first released, there was a user posting snippets that just draw inappropriate things on the screen when you run them.2016年08月07日 18:23:31 +00:00Commented Aug 7, 2016 at 18:23
-
@Gothdo It's possible to do phishing attacks.Oriol– Oriol2016年08月09日 01:35:50 +00:00Commented Aug 9, 2016 at 1:35
-
Wow, what a horrible design decisionTylerH– TylerH2019年11月12日 20:51:42 +00:00Commented Nov 12, 2019 at 20:51
-
I feel like this feature should be published somewhere, this is the first I've ever heard of this. I just encountered it in the wild and searched around to check if the "bug" had happened before, turns out it's a feature instead.zcoop98– zcoop982021年02月19日 21:44:57 +00:00Commented Feb 19, 2021 at 21:44
[Run snippet]
button replaced by a notice that the Snippet has been disabled in this situation.:)