Bitzu

CPSA ยท Web servers, architecture and protocols

Server extension interfaces

CGI, ISAPI filters and Apache modules and the risks of each.

Key points

  • CGI: an external program per request, data via environment variables and stdin; slow, and unsafe argument handling allows command injection.
  • ISAPI (legacy IIS): filters intercept every request; extensions are DLLs for specific requests; Microsoft recommends IIS modules over ISAPI filters.
  • Apache modules (mod_*): loaded into the server process.
  • Filters and modules see every request: remove unneeded ones, patch the rest.

Source: https://learn.microsoft.com/en-us/iis/configuration/system.webserver/isapifilters/

Practice questions

Single choice

What does an ISAPI filter do in IIS?

  1. Intercepts requests to the server or site
  2. Stores relational data
  3. Sends email for users
  4. Resolves domain names
Show answer

Answer: A. Intercepts requests to the server or site

An ISAPI filter intercepts requests made to a server or site and can change or log them. It is not a database engine, an email client or a DNS record.

Select all that apply

Which practices reduce the risk of server extensions?

  1. Remove modules and ISAPI filters that are not needed
  2. Patch third-party modules
  3. Leave sample CGI scripts for troubleshooting
  4. Load every available module just in case
  5. Run the extension with maximum privileges
Show answer

Answer: A. Remove modules and ISAPI filters that are not needed, B. Patch third-party modules

Removing unused modules and patching third-party ones shrinks and secures the attack surface. Installing more modules, or leaving sample CGI scripts in place, does the opposite.

True or false

True or false: CGI scripts are safe from injection because they run in a separate process from the web server.

Show answer

Answer: False

False. A separate process does not sanitise input; if the script builds commands or queries from raw request data, injection is still possible.

Practice 8 questions on this topic in Bitzu

Short lessons, instant explanations and spaced review of what you get wrong. Free on iOS and Android.

Download on the App StoreGet it on Google Play

More CPSA topics in this module