CAPECattack pattern
CAPEC-101 Server Side Include (SSI) Injection
High
Official page ↗
- Abstraction
- Detailed
- Status
- Draft
- Likelihood of attack
- High
- Typical severity
- High
- CAPEC version
- 3.9
Description
An attacker can use Server Side Include (SSI) Injection to send code to a web application that then gets executed by the web server. Doing so enables the attacker to achieve similar results to Cross Site Scripting, viz., arbitrary code execution and information disclosure, albeit on a more limited scale, since the SSI directives are nowhere near as powerful as a full-fledged scripting language. Nonetheless, the attacker can conveniently gain access to sensitive files, such as password files, and execute shell commands.
Execution flow
1. [Explore] [Determine applicability] The adversary determines whether server side includes are enabled on the target web server.
2. [Experiment] [Find Injection Point] Look for user controllable input, including HTTP headers, that can carry server side include directives to the web server.
3. [Exploit] [Inject SSI] Using the found injection point, the adversary sends arbitrary code to be inlcuded by the application on the server side. They may then need to view a particular page in order to have the server execute the include directive and run a command or open a file on behalf of the adversary.
Prerequisites
• A web server that supports server side includes and has them enabled
• User controllable input that can carry include directives to the web server
Skills required
• [Medium] The attacker needs to be aware of SSI technology, determine the nature of injection and be able to craft input that results in the SSI directives being executed.
Consequences
• Confidentiality: Read Data
• Confidentiality, Integrity, Availability: Execute Unauthorized Commands
Mitigations
• Set the OPTIONS IncludesNOEXEC in the global access.conf file or local .htaccess (Apache) file to deny SSI execution in directories that do not need them
• All user controllable input must be appropriately sanitized before use in the application. This includes omitting, or encoding, certain characters or strings that have the potential of being interpreted as part of an SSI directive
• Server Side Includes must be enabled only if there is a strong business reason to do so. Every additional component enabled on the web server increases the attack surface as well as administrative overhead
Related
Can precede · CAPEC (1)
- CAPEC-600 Credential Stuffing attack pattern
Child of · CAPEC (1)
- CAPEC-253 Remote Code Inclusion attack pattern