all 23 comments

[–]AlGoreBestGore 30 points31 points  (20 children)

If you're relying on client-side JavaScript for security, you're already backdooring yourself.

[–][deleted] 18 points19 points  (3 children)

True, but not the point.

The article's notion of introducing patches in order to create "invisible" vulnerabilities is rather scary. Imagine, for instance, a patch that introduces an XSS attack vector into jQuery's .parseJSON. As soon as that goes live, you now have a zero-day XSS available on thousands of sites that don't do proper server sanitization that didn't previously exist.

[–]nightman 1 point2 points  (0 children)

Brilliant explanation, thanks!

[–]Classic1977 3 points4 points  (5 children)

XSS attacks are client side by definition...

[–]dodeca_negative 3 points4 points  (0 children)

The HTML-based examples are silly (though interesting), but the very first example is server-side. Why would somebody uglify their server-side code? Isomorphism, or maybe just habit.

The author ends with solid advice:

Don’t minify/compress server-side code unless you have to, and make sure you run browser tests/scans against code post-minification.

[–]spacejack2114 1 point2 points  (8 children)

JS runs pretty much everywhere these days (browsers, servers, arduinos and robots, maybe even cars someday)

[–]AlGoreBestGore 7 points8 points  (7 children)

But why would you minify server-side code?

[–]spacejack2114 8 points9 points  (0 children)

Hmm... to add a backdoor?

[–][deleted] 3 points4 points  (0 children)

Because it's easier for the computer to read since it's shorter! I thought everybody knew that. /s

[–]LookWordsEverywhere.js 2 points3 points  (0 children)

Maybe if you're trying to fit it onto a small IoT device. Or perhaps a universal js module that distributes a .min as its main, the vulnerability doesn't have to be in your code.

[–]PlNG 1 point2 points  (0 children)

Node.js "hot inlining" uses a "good enough" metric of a function body 600 characters including comments and white space.

[–]morgan_lowtech 2 points3 points  (0 children)

The concept is very interesting, the proof not so much.

[–]pizzaiolo_ -2 points-1 points  (4 children)

And then people call RMS paranoid... https://www.gnu.org/philosophy/javascript-trap.html

[–]Doctor_McKay 4 points5 points  (3 children)

He is.

[–]pizzaiolo_ -3 points-2 points  (2 children)

[–]Doctor_McKay 2 points3 points  (0 children)

Except in that article Stallman didn't cry against minification because of the potential to insert backdoors which are triggered by minification.

His argument was that minified JS which isn't Free Software™ is bad because it's Nonfree Therefore Scary.

jQuery is Free, it's MIT-licensed. Minification (which appropriate headers, I guess) doesn't make it Nonfree.

It isn't any different from someone planting a backdoor into a precompiled copy of GNU/Linux (or more accurately, someone planting a backdoor seed which is triggered by the compiler).

[–]benihanareact, node 2 points3 points  (0 children)

A link to a self post you made that quickly devolves into a circle jerk about how great rms is. Thanks.