ASP.NET ViewState MAC Not Enabled

medium Web App Scanning Plugin ID 112924

Synopsis

ASP.NET ViewState MAC Not Enabled

Description

The ViewState is a parameter specific to the ASP.NET framework, it's used as a breadcrumb trail when the user navigates the application preserving values and controls between different web pages. Present on the pages in the __viewstate parameter, all the values are serialized and encoded in base64 in a hidden field. In addition to the base64 encoding, the viewstate can also be signed with a MAC (Message Authentication Code) to guarantee integrity and also encrypted to guarantee confidentiality.

If the viewstate is not signed, depending on the information stored inside, an attacker might be able to modify the information stored inside.

Solution

ASP.NET provides MAC validation for ViewState parameters by adding '<%@Page EnableViewStateMAC='True' %>' on the specific page or by adding '<pages enableViewStateMac='true'>' inside your web.config file.

See Also

https://devblogs.microsoft.com/aspnet/cryptographic-improvements-in-asp-net-4-5-pt-2/

https://docs.microsoft.com/en-us/dotnet/api/system.web.ui.page.enableviewstatemac?view=netframework-4.8

https://docs.microsoft.com/en-us/previous-versions/dotnet/articles/ms972976(v=msdn.10)

Plugin Details

Severity: Medium

ID: 112924

Type: remote

Published: 8/5/2021

Updated: 2/1/2022

Scan Template: basic, full, pci, scan

Risk Information

VPR

Risk Factor: Low

Score: 1.4

CVSS v2

Risk Factor: Medium

Base Score: 5

Vector: CVSS2#AV:N/AC:L/Au:N/C:N/I:P/A:N

CVSS Score Source: Tenable

CVSS v3

Risk Factor: Medium

Base Score: 5.3

Vector: CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N

CVSS Score Source: Tenable

Vulnerability Information

CPE: cpe:2.3:a:microsoft:microsoft_.net_framework:*:*:*:*:*:*:*:*

Reference Information