Enabling HTTP verb permissions
Verb tampering is an attack that exploits vulnerabilities in HTTP verbs authentication and access control mechanisms. To mitigate verb tampering in your web server, configure the web server's HTTP verb permissions to limit access to only selected HTTP verbs.
About this task
Hypertext transfer protocol provides a list of methods that you can use to perform actions on a web server. Verb tampering vulnerabilities can occur when security constraints that specify HTTP verbs allow more access than intended.
In Java™ Platform, Enterprise Edition version 7 or later, you can limit access to only permitted HTTP verbs by configuring the web application deployment descriptor. However, the required web application deployment descriptor configuration is not supported by the Java Platform, Enterprise Edition version that the IBM® Cúram Social Program Management application currently supports. As an alternative solution, you can configure the web server in your Social Program Management application deployment environment to permit only required HTTP verbs. Use the following procedure to configure both IBM HTTP Server and Oracle HTTP Server.
Procedure
Example
- Configuration example 1
- Configuration example 1 works as shown in the following description:
- Loads the Apache mod_rewrite module that is available in IBM HTTP Server and Oracle HTTP Server, if it is not loaded.
- Enables the Rewrite Engine, signifying a code block to enable rewrite.
- Applies an
If
condition on the Request method if it does not match (!
) the Regex expression that is denoted by the string between the start (^
) and end ($
) delimiters, in this case the GET, POST, PUT, DELETE, or OPTIONS verbs. - If the condition is
true
, in that it does not match the condition HTTP verbs on the matching Regex url (.* = all URLs
), send a 403 Forbidden response ([F]
) while also using the pass-through flag ([PT]
) to overwrite any IBM WebSphere® Application Server plug-in.
``` <IfModule !mod_rewrite.c> LoadModule rewrite_module {path_to_modules}/mod_rewrite.so </IfModule> <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_METHOD} !^(GET|POST|PUT|DELETE|OPTIONS)$ RewriteRule .* - [PT,F] </IfModule> ```
- Configuration example 2
- Configuration example 2 ensures that the mod_rewrite rules also act in https protocol and not
just in http protocol.
Insert the previous example in the block that contains the following code:``` RewriteEngine On RewriteOptions Inherit ```
``` <VirtualHost *:443> ... </VirtualHost> ```