Live data from Hacker News

Hide this in your coworkers' JavaScript code tomorrow

gist.github.com

1–10 of 40 posts

Re: Hide this in your coworkers' JavaScript code tomorrow

#2
A silly prank, but it makes me wonder: has anyone implemented an antivirus/anti-problem scanner for open source code? i.e. scan the source code on a git repository and report any suspicious code that matches known malicious patterns? Lint, but targeted at detecting likely security flaws and code injections.

Re: Hide this in your coworkers' JavaScript code tomorrow

#3
On a related note, I got a pleasent surprise when I opened the Developer Console on Facebook.com: they present you with a giant red warningp[1] and block any code execution in it until you explicitly 'allow [your] account to be hijacked if I paste malicious Javascript'[2]

[1]: http://i.imgur.com/6UVaTen.png

[2]: https://www.facebook.com/selfxss

Re: Hide this in your coworkers' JavaScript code tomorrow

#4
Yes kill your coworker's productivity by making her or him even more miserable when dealing with a bug. If you did this and I was your manager, at worst you'd end up on a PIP. If you want conduct a prank do something that doesn't frustrate the work they're paid to do.

Re: Hide this in your coworkers' JavaScript code tomorrow

#5

On a related note, I got a pleasent surprise when I opened the Developer Console on Facebook.com: they present you with a giant red warningp[1] and block any code execution in it until you explicitly 'allow [your] account to be hijacked if I paste malicious Javascript'[2] [1]: http://i.imgur.com/6UVaTen.png [2]: https://www.facebook.com/selfxss

Facebook blocks the console as it is supposedly used for " exploitation by people to post spam and even used to "hack" accounts"

http://stackoverflow.com/questions/21692646/how-does-faceboo...

Re: Hide this in your coworkers' JavaScript code tomorrow

#6
post #2

A silly prank, but it makes me wonder: has anyone implemented an antivirus/anti-problem scanner for open source code? i.e. scan the source code on a git repository and report any suspicious code that matches known malicious patterns? Lint, but targeted at detecting likely security flaws and code injections.

Coverity regularly scan open-source C/C++ projects and email contributors reports.

I've received a few such emails. Its a good way to market developer tools.

Re: Hide this in your coworkers' JavaScript code tomorrow

#7
One of my favourite ways to punish JavaScript developers who don't use `var` is to randomly hide a

    if (false) {
      var GLOBALVAR;
    }
somewhere in the code.

It's fun (in a harmless fun kinda way, but you can also use some really dirty tricks to really hamper someone's work) to fuck up people's code - that's why I wrote Underhanded JavaScript. :P

EDIT:

Another fun one is to add `return`s to constructor functions.

Re: Hide this in your coworkers' JavaScript code tomorrow

#8
post #2

A silly prank, but it makes me wonder: has anyone implemented an antivirus/anti-problem scanner for open source code? i.e. scan the source code on a git repository and report any suspicious code that matches known malicious patterns? Lint, but targeted at detecting likely security flaws and code injections.

Sounds incredibly resource intensive. First, the sheer number of "open-source" projects which grow whenever someone has a new idea or some frustration with an existing solution. I guess you could try to limit the tool to a list of established projects but that of course limits the effectiveness of what you're trying to do. Established projects may be more attractive as a delivery vector due to widespread adoption, but there's also more eyes looking at the code giving a potentially higher chance of discovery of any exploits. And new projects have less-deployment and potentially more active contributors who might more easily catch some exploit slipped in.

Then there's the problem that you've got how many languages you need to scan against? And no quick way to determine what language a project is implemented in? Sure, you could add some sort of language detection in there but then you're adding to the overhead.

Finally, if the project has any sort of real complexity, some of the best areas to exploit would be in the integrations between two technology surfaces. Writing a tool to look for problems in a single contained module is one thing, writing a tool that can find problems in the interfaces between modules is quite a bit more complicated.

I think your "anti-problem" scanning tool would be the best avenue to pursue though. Maybe some sort of tool that would run on "checkin/pull-request" and look for issues like introduced buffer-overflow potential and things like that.

I think it's just easier to rely on solid projects with "known" contributors to police themselves and hope for the best, as bad as that may sound. Still, if you could create such a tool you'd make a fortune and improve the world immensely, so don't let my nay-saying stop you.

Post reply on HN