Can a user break out of <textarea>
tag maliciously?
For example:
post form contains:
<form action='post.php' method='post'>
<textarea name='content'></textarea>
<input type='submit' value='submit'>
</form>
post.php
stores htmlentities($content)
in the database.
Now the user wants to edit his post, he clicks 'edit' and retrieves the edit form except this time the code is decoded and injected in, for editing purposes.
edit form contains:
<form action='edit.php' method='post'>
<textarea name='content'><?=html_entity_decode($content);?></textarea>
<input type='submit' value='submit'>
</form>
is it possible for the user to break out of the textarea tags, seeing as the content has now been decoded back into normal html. Also should one store htmlentities($content)
in the database or simply raw html, then, encode on the display page - what are the SQL dangers of that technique?
I have tried </textarea>
, <!-- --></>
. To be honest I'm not to familiar with XSS attacks but I usually know how to prevent from them.
In this case can someone break out of the <textarea></textarea>
tags?