r/programming • • May 10 '18

Java: Executing code in comments?!

http://programming.guide/java/executing-code-in-comments.html
260 Upvotes

84 comments sorted by

View all comments

2

u/gurenkagurenda May 11 '18

I'm glad to see this getting attention again. This is an opportunity for a clever attacker to sneak a backdoor into a code base, potentially right under a code reviewer's nose. All you need is an excuse to put some apparently commented out "example" or "debug" code containing some unicode escapes. As long as the syntax highlighter thinks the code is commented out, there's a good chance a reviewer won't give it a second glance.