.Net applications that invoke NetFx40_LegacySecurityPolicy must apply previous versions of .NET STIG guidance.

Severity
Group ID
Group Title
Version
Rule ID
Date
STIG Version
lowV-225232SRG-APP-000516APPNET0064SV-225232r1050651_rule2025-02-202
Description
CAS policy is .NET runtime version-specific. In .NET Framework version 4, CAS policy is disabled by default however; it can be re-enabled by using the NetFx40_LegacySecurityPolicy setting on a per application basis. Caspol.exe is provided by Microsoft to set security policy on .Net applications prior to version 4.0. This requirement does not apply to the caspol.exe assembly or other assemblies provided with the Windows OS or the Windows Secure Host Baseline (SHB). When invoking the NetFx40_LegacySecurityPolicy setting in .NET 4, earlier versions of the .NET Framework CAS policy will become active therefore previous .NET STIG guidance that applies to the reactivated versions must also be applied. Failure to apply applicable versions of STIG guidance can result in the loss of system confidentiality, integrity or availability.
ℹ️ Check
The infrastructure to enable Code Access Security (CAS) exists only in .NET Framework 2.x - 4.x. The requirement is Not Applicable (NA) for .NET Framework > 4.x. (Note: The infrastructure is deprecated and is not receiving servicing or security fixes.) Open Windows explorer and search for all *.exe.config files. This requirement does not apply to the caspol.exe assembly or other assemblies provided with the Windows OS or the Windows Secure Host Baseline (SHB). To find relevant files, run the FINDSTR command from an elevated (admin) command prompt: FINDSTR /i /s "NetFx40_LegacySecurityPolicy" c:\*.exe.config This command will search all ."exe.config" files on the c: drive partition for the "LegacySecurityPolicy" setting. Repeat the command for each drive partition on the system. If the .NET application configuration file uses the legacy policy element, and .NET STIG guidance that covers these legacy versions has not been applied, this is a finding.
✔️ Fix
The infrastructure to enable CAS exists only in .NET Framework 2.x - 4.x. The requirement is Not Applicable (NA) for .NET Framework > 4.x. (Note: The infrastructure is deprecated and is not receiving servicing or security fixes.) Apply the .NET Framework Security Checklist for .Net versions 1 through 3.5 when using the NetFx40_LegacySecurityPolicy setting.