|The Vigil@nce team watches public vulnerabilities impacting your computers, and then offers security solutions, a database and tools to fix them.|
ASP.NET: information disclosure via Padding Oracle
Synthesis of the vulnerability
An attacker can use ASP.NET as an "oracle" to decrypt information such as the View State object, or read a file such as "web.config".
Impacted products: IIS, .NET Framework, Windows 2000, Windows 2003, Windows 2008 R0, Windows 2008 R2, Windows 7, Windows Vista, Windows XP, SUSE Linux Enterprise Desktop, SLES.
Creation date: 20/09/2010.
Identifiers: 2416728, 2418042, BID-43316, CERTA-2010-AVI-458, CVE-2010-3332, MS10-070, SUSE-SU-2012:0393-1, VIGILANCE-VUL-9953.
Description of the vulnerability
An ASP page can use a hidden variable named __VIEWSTATE, containing the state of a form. This View State, as well as cookie content, can be encrypted with AES.
When the size of data is not a multiple of the size of encryption blocks, padding bytes are added. The PKSC#7 padding adds bytes whose value is the padding size. For example:
- 02 02
The clear content of the padding is thus known.
When the padding is invalid, an ASP.NET application generates the System.Security.Cryptography.CryptographicException exception ("Padding is invalid and cannot be removed"). This error message is different from other messages. An ASP.NET application can thus act as an oracle indicating if a block is valid.
An attacker can therefore, one byte at a time, vary the padding to obtain a different error message, and progressively determine the encryption key. The attacker can then for example decrypt the content of View State or cookies. He can also encrypt malicious data and send them to the server, which will interpret them as valid.
With extension, this vulnerability can also be used to read files reachable by the application, such as "web.config".
An attacker can therefore use ASP.NET as an "oracle" to decrypt information such as the View State object, or read a file such as "web.config".
Complete Vigil@nce bulletin.... (Free trial)
Computer vulnerabilities tracking service
Vigil@nce provides an applications vulnerabilities patch. The Vigil@nce team tracks computer vulnerabilities impacting systems and applications. The Vigil@nce computer vulnerability tracking service alerts your teams of vulnerabilities or threats impacting your information system. The Vigil@nce security watch publishes vulnerability bulletins about threats impacting the information system.