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
What does an ISAPI filter do in IIS?
- Intercepts requests to the server or site
- Stores relational data
- Sends email for users
- 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.
Which practices reduce the risk of server extensions?
- Remove modules and ISAPI filters that are not needed
- Patch third-party modules
- Leave sample CGI scripts for troubleshooting
- Load every available module just in case
- 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: 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.

More CPSA topics in this module
- Web server operation, virtual hosting and proxies
- IIS and Apache and their typical flaws
- Tiered web architectures
- HTTP methods and response codes
- HTTPS, SOAP and security-related headers
- HTML and XML
- Server-side and client-side web languages
- Application servers and frameworks
- Thin and thick web clients, applets and decompilation