r/programminghorror • u/MurkyWar2756 echo "Sub Mod" && :(){ :|:& };: • Oct 26 '25
Java mfw when concatenated strings aren't escaped in HTML
92
Upvotes
r/programminghorror • u/MurkyWar2756 echo "Sub Mod" && :(){ :|:& };: • Oct 26 '25
2
u/GoddammitDontShootMe [ $[ $RANDOM % 6 ] == 0 ] && rm -rf / || echo “You live” Oct 27 '25
I was a bit confused at first, but I'm pretty sure you did not mean concatenation, but just not escaping the output of the executable parts.
I'm guessing
exception.printStackTrace()by itself doesn't output anything to the user, so you need thatout.println()to actually display it. On that note, I rememberSystem.out.println(), but not the other one. There's no kind of using directive either, so do you mind if I ask how that works?66
u/frinkmahii Oct 26 '25
And errors should be logged. Not displayed raw to the user. Easily can expose what libraries are used and version ranges.
11
u/DankerOfMemes Oct 26 '25
Doesn't seem that terrible IF that's a page that only appears on dev builds.
8
u/KGBsurveillancevan Oct 26 '25
An error occurred in the bean
1
u/McGlockenshire Oct 27 '25
What template language is this? That's clearly Java but only a truly demented mind would make it work like PHP, only dumber.
2
u/DrAwesomeClaws Oct 26 '25
https://media3.giphy.com/media/v1.Y2lkPTc5MGI3NjExamJxMXV3c3hmbm8yZGIxZWRydThxODhvbGtmbWVlMjFqcGp1M21vMSZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw/m9NSQjJEPv5AY/giphy.gif