Re:Code that is valid in both PHP and Java, and produces the...
by yorwba on Thursday September 01, 2016 @03:28AM
(#12403612)
I just tried this in Android Studio, Eclipse, Emacs, Gedit, Nano, Vim and all of them get this wrong.
I feel the sudden urge to test every Java syntax highlighter in use and file lots of issues.
Re:Code that is valid in both PHP and Java, and produces the...
by i336_ on Thursday September 01, 2016 @03:57AM
(#12403676)
GitHub definitely needs to know about this due to their popularity and subsequent lowest-common-denominator status (which isn't a bad thing, just the truth); this sort of attack only requires a PhD in how to use the clipboard, and not any other particular knowledge or skillset.
Re:Code that is valid in both PHP and Java, and produces the...
by yorwba on Thursday September 01, 2016 @06:00AM
(#12404041)
GitHub indirectly uses the Java bundle for TextMate, where I filed this issue: https://github.com/textmate/java.tmbundle/issues/45
Since the escape sequences have to be handled everywhere, it seems unlikely that this will ever be fixed completely, but I hope that something will be done about it.
Re:Code that is valid in both PHP and Java, and produces the...
by yorwba on Thursday September 01, 2016 @08:29AM
(#12404725)
This issue has also been raised on the Eclipse bug tracker: https://bugs.eclipse.org/bugs/show_bug.cgi?id=3533
In 2001.
So if you want to sneak in a back door, all you need is the right excuse to put some unicode escapes in a block comment, and you can hide your code in plain sight.
Something like:
https://gist.github.com/anonymous/f33c1e392193a9ec30dcc5b31d...
I tried this in Eclipse, and the one saving grace is that while the basic syntax highlighting doesn't pick up on most of the de-commented part, the code intel seems to do an actual parse, and does a very subtle highlighting of "someService". (Edit: After reopening the file, that highlight is gone and it looks like a normal comment).
But if I saw that, I think I'd just assume the syntax coloring was messing up. And of course, if I'm looking at the code in GitHub, it will look just like a normal comment.