File upload protection
Many attackers try to upload malicious code, virus, or malware as file attachments during multi-form submission. It is important to protect our network and overcome such threats. To prevent such malicious file uploads, a Citrix ADC admin can now configure a set of allowable file upload formats in the WAF profile. By doing this, you restrict file uploads to specific formats and protect the appliance against malicious file uploads. But, the protection works only when you disable the “ExcludeFileUploadFormChecks” option in the WAF profile.
How file upload works
When you configure allowable file upload formats, the component interaction is as follows:
- Client request has a form submission with a file upload type, for example pdf.
- As part of security check, WAF inspects the request payload and validates the file type (based on magic signature numbers).
- If the file type is an allowable file format, the corresponding action based on file type binding is applied.
- To validate the file type the appliance inspects the payload and checks for the known magic number(s) at known offsets. Each file type has a sequence of magic numbers that validates the file type.
- Only if the validation passes, WAF identifies the file as an allowable format and the associated action is applied.
Configure file type upload by using Citrix ADC CLI
To configure allowable file formats, the appliance uses a WAF profile that is bound to file upload parameters.
- Configure Web Application Firewall profile
To configure a web application firewall profile, type the following:
set appfw profile <profile_name> [-fileUploadTypesAction <fileUploadTypesAction>]<fileUploadTypesAction> = ( none | block | log | stats )
set appfw profile profile1 –fileUploadTypesAction block
- Bind Web Application Firewall profile with file upload parameters.
To bind a profile with file upload parameters, type the following:
bind appfw profile <profile_name> - fileUploadType <form_field > <form_action_url> -fileType <fileType> ( pdf | msdoc | text | image | any)
bind appfw profile profile1 -fileuploadType image action_url -fileType image
Configure file type upload by using Citrix ADC GUI
Follow the procedure below to set the file upload settings.
- In the navigation pane, navigate to Security > Profiles.
- In the Profiles page, click Add.
- In the Citrix Web App Firewall Profile page, click Security Checks under Advanced Settings.
In the Security Checks section, go to File Upload Types settings.
- Select the check box and click Action Settings.
- In the File Upload Types Settings page, set the file upload action.
- Click OK.
In the Citrix Web App Firewall Profile page, click OK and Done.