Preventing a security breach
Posted
by
Wiz
on Stack Overflow
See other posts from Stack Overflow
or by Wiz
Published on 2012-07-07T21:08:29Z
Indexed on
2012/07/07
21:15 UTC
Read the original article
Hit count: 273
I am creating a website where you "post", and the form content is saved in a MySql database, and upon loading the page, is retrieved, similar to facebook. I construct all the posts and insert raw html into a template. The thing is, as I was testing, I noticed that I could write javascript or other HTML into the form and submit it, and upon reloading, the html or JS would treated as source code, not a post. I figured that some simple encoding would do the trick, but using is not working. Is there an efficient way to prevent this type of security hole?
© Stack Overflow or respective owner