Suppose I have a registration page in my website that contains a registration form:
<form action="register.php" method="post">
<input name="...">
<input...>
...
<input type='submit'>
</form>
Then someone else made his own page and used my form's action page:
<form action="http://mywebsitename.com/register.php" method="post">
Can he post his own data to my page this way? If so how can I prevent this?
Edit: It seems that using a token and storing its value in a session variable does not prevent someone from submitting data from his own form (even if the token is generated every page request) by first opening my original page (so a session for him is started and a token for that session is generated) and then using that token in his own form, while still in the session.
So I think Quentin is right, data must be validated anyway in the action page before it is accepted.
Thanks everybody.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…