Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 434791
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T20:18:37+00:00 2026-05-12T20:18:37+00:00

I understand that the AntiForgeryToken feature in ASP.NET MVC does prevent cross-site attacks. However,

  • 0

I understand that the AntiForgeryToken feature in ASP.NET MVC does prevent cross-site attacks.

However, does it prevent from changing form values before POST?

For example, a malicious attacker may find out that the rating page always contains a hidden field contaning the rated entity ID and create POST requests to artificially rate all his own entities high.

What is the preferred way to ensure that the form values between a GET and a POST have not been changed?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T20:18:37+00:00Added an answer on May 12, 2026 at 8:18 pm

    AntiForgeryToken prevents a malicious site to trick a user to a form that looks the same as the original and post it to the original site. It does not prevent the scenario you are describing. Here’s how an attacker could proceed in order to circumvent the token:

    1. The hacker sends a GET request to the form.
    2. He reads the value of the cookie generated by the AntiForgeryToken
    3. He POSTs to the url handling the form action by sending the cookie, the RequestVerificationToken hidden field which has the same value as the cookie and the modified entity ID.

    As you can see the only difference to as if you haven’t used AntiForgeryToken is that the hacker needs to send an additional GET request to read the value of the token.

    There’s absolutely no way to prevent an attacker from modifying the value of a hidden field other than verifying that the user who submitted the form (I suppose that in order to vote the user has to be authenticated) is not the owner of the entity ID he is voting for.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I understand that the page load of asp.net (mvc 2.0ish) sites can suffer for
I understand that unique IV is important in encrypting to prevent attacks like frequency
I understand that server-side validation is an absolute must to prevent malicious users (or
I understand that IronPython is an implementation of Python on the .NET platform just
I understand that MVC & MVP are design patterns that are commonly used for
I understand that a typical .NET application that accesses a(n SQL Server) database doesn't
I understand that modules are essentially like c++ functions. However, I didn't find something
I understand that C# does not support multiple inheritance, and that the solution is
I understand that PHP does not support multithreading but I would love to know
I understand that some countries have laws regarding website accessibility. In general, what are

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.