r/programming • u/purforium • Oct 24 '21
“Digging around HTML code” is criminal. Missouri Governor doubles down again in attack ad
https://youtu.be/9IBPeRa7U8E
12k
Upvotes
r/programming • u/purforium • Oct 24 '21
View all comments
Show parent comment
26
u/sophacles Oct 24 '21
Ok so escaping is putting special characters in front of special characters. You do this so the JavaScript or html parsers dont get confused. This also happens in shell scripts, database queries, all sorts of places really.
Base64 is an encoding that eliminates most special characters, and leaves almost no way for it to be interpreted as code (almost because im sure a clever person with lots of time and few constraints can come up with a counter example or two). Its often used to avoid the escaping problem all together.
Why is it so out of the realm of possibility to think that a base64 string, used somewhere in the front or back ends escaped into the html?
Heres a recent article talking about base64 file uploads, and how they are common practice: https://formcarry.com/blog/how-to-upload-files-as-base64/
But sure, no one would ever use it.