4.7 Ensure Unlisted File Extensions are not allowed - Default

Information

The FileExtensions Request Filter allows administrators to define specific extensions their web server(s) will allow and disallow. The property allowUnlisted will cover all other file extensions not explicitly allowed or denied. Often times, extensions such as .config, .bat, .exe, to name a few, should never be served. The AllowExtensions and DenyExtensions options are the UrlScan equivalents.

It is recommended that all extensions be disallowed at the most global level possible, with only those necessary being allowed.

Rationale:

Disallowing all but the necessary file extensions can greatly reduce the attack surface of applications and servers.

Impact:

If not set properly, file extensions that are needed will be rejected.

Solution

The allowUnlisted Request Filter may be set for a server, website, or application using the IIS Manager GUI, using AppCmd.exe commands in a command-line window, and/or directly editing the configuration files. To configure at the server level using the IIS Manager GUI:

Open Internet Information Services (IIS) Manager

In the Connections pane, select the server

In the Home pane, double-click Request Filtering

Click Edit Feature Settings... in the Actions pane

Under the General section, uncheck Allow unlisted file name extensions

Enter the following command in AppCmd.exe to configure:

%systemroot%\system32\inetsrv\appcmd set config /section:requestfiltering /fileExtensions.allowunlisted:false

OR

Enter the following command in PowerShell to configure:

Set-WebConfigurationProperty -pspath 'MACHINE/WEBROOT/APPHOST' -filter 'system.webServer/security/requestFiltering/fileExtensions' -name 'allowUnlisted' -value 'False'

Default Value:

The default Request Filtering configuration allows all unlisted file extensions to be requested.

See Also

https://workbench.cisecurity.org/benchmarks/13949

Item Details

Category: SYSTEM AND SERVICES ACQUISITION

References: 800-53|SA-8, CSCv7|18

Plugin: Windows

Control ID: 747dae1e3223674765c54245c8823a655cabc46bae9000f7c43208313da3ab3e