PRB: Potential Security Vulnerability When Class Overrides Internal or Private Virtual Method (313499)
The information in this article applies to:
This article was previously published under Q313499 SYMPTOMS
If you use the Intermediate Language (IL) byte code language to write a class, that class might override virtual class methods that are marked internal or private. Although the C# compiler and the Visual Basic compiler warn you about this potential security vulnerability, the JScript compiler does not.
RESOLUTION
To avoid this kind of attack, make sure that all public classes that manipulate security-sensitive data protect themselves from a hostile override. To do this, use one or more of the following methods:
- Seal the class.
- Put an inheritance demand on the class.
- Make the class internal to the package.
- Make the methods final.
- Do not use AllowPartiallyTrustedCallersAttribute on the assembly.
Preferably, use as many of the preceding methods as possible.
STATUSThis behavior is by design.
Modification Type: | Major | Last Reviewed: | 4/18/2002 |
---|
Keywords: | kbprb KB313499 |
---|
|