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

  • SEARCH
  • Home
  • 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 8106909
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T00:36:23+00:00 2026-06-06T00:36:23+00:00

Question ASP and ASP.NET web applications use a value called VIEWSTATE in forms. From

  • 0

Question

ASP and ASP.NET web applications use a value called VIEWSTATE in forms. From what I understand, this is used to persist some kind of state on the client between requests to the web server.

I have never worked with ASP or ASP.NET and need some help with two questions (and some sub-questions):

1) Is it possible to programmatically spoof/construct a VIEWSTATE for a form? Clarification: can a program look at a form and from that construct the contents of the base64-encoded VIEWSTATE value?

1 a) Or can it always just be left out?

1 b) Can an old VIEWSTATE for a particular form be reused in a later invocation of the same form, or would it just be luck if that worked?

2) I gather from http://msdn.microsoft.com/en-us/library/ms972976.aspx#viewstate_topic12 that it is possible to turn on security so that the VIEWSTATE becomes secure from spoofing. Is it possible for a program to detect that a VIEWSTATE is safeguarded in such a way?

2 a) Is there a one-to-one mapping between the occurrence of EVENTVALIDATION values and secure VIEWSTATEs?

Regarding 1) and 2), if yes, can I have a hint about how I would do that? For 2) I am thinking I could base64-decode the value and search for a string that always is found in unencrypted VIEWSTATEs. “First:”? Something else?

Background

I have made a small tool for detecting and exploiting so called CSRF vulnerabilities. I use it to quickly make proof of concepts of such vulnerabilities that I send to the affected site owners. Quite often I encounter these forms with a VIEWSTATE, and these I don’t know if they are secure or not.

Edit 1: Clarified question 1 somewhat.

Edit 2: Added text in italics.

  • 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-06-06T00:36:25+00:00Added an answer on June 6, 2026 at 12:36 am

    Is it possible to programmatically spoof/construct a VIEWSTATE for a form?

    Sure. It’s just a Base64 encoded value. Now, since ASP.NET 2.0 there has been an option where the viewstate can be encrypted by the Machine Key, but that is an opt-in feature. Generally, you don’t want to be putting anything private in the view state in the first place.

    Or can it always just be left out?

    Some of ASP.NET’s plumbing requires ViewState, turning it off completely is rather difficult if you still want to use the ASP.NET Server Controls.

    Can an old VIEWSTATE for a particular form be reused in a later invocation of the same form, or would it just be luck if that worked?

    That’s called a replay attack

    Yes, it is possible. Here is a blog post demonstrating it.

    Is there a one-to-one mapping between the occurrence of EVENTVALIDATION values and secure VIEWSTATEs?

    Not really. Event Validation is basically used to ensure that the client side event matches a “possible” event that could have happened on the server. It mostly protects and ensure that hidden inputs like __EVENTTARGET haven’t been tampered with.

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

Sidebar

Related Questions

This is a follow-up question to ASP.NET How to pass container value as javascript
I usually use ASP.net web forms for GUI, maybe one of most stateful technologies.
A simple question. I have an ASP.NET web application which contains several assemblies and
Age old question! When you have finished developing and testing your ASP.Net web application,
Well, simple question. I'm working with VS2008 on an ASP.NET web application which has
I have one question; In my ASP.NET MVC web application have to do certain
Newbie question: There are three types of Asp.Net controls : HTML server controls, Web
This is a followup on the question: ASP.NET next/previous buttons to display single row
I asked this question: Is ASP.NET MVC destined to replace Webforms? and a few
What is XSD and how to use it in ASP.NET Web application. I have

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.