---
title: "CAPEC-101: Server Side Include (SSI) Injection"
url: https://radicalnotion.ai/capec/capec-101
type: capec
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."
updated: 2026-06-01
source: RadicalNotion.AI
license: CC BY-NC 4.0 (https://creativecommons.org/licenses/by-nc/4.0/)
---

# CAPEC-101: Server Side Include (SSI) Injection

- **Abstraction:** Detailed
- **Status:** Draft
- **Typical severity:** High
- **Likelihood of attack:** High
- **CAPEC catalog 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

### Step 1: Explore

\[Determine applicability\] The adversary determines whether server side includes are enabled on the target web server.

- Look for popular page file names. The attacker will look for .shtml, .shtm, .asp, .aspx, and other well-known strings in URLs to help determine whether SSI functionality is enabled.
- Fetch .htaccess file. In Apache web server installations, the .htaccess file may enable server side includes in specific locations. In those cases, the .htaccess file lives inside the directory where SSI is enabled, and is theoretically fetchable from the web server. Although most web servers deny fetching the .htaccess file, a misconfigured server will allow it. Thus, an attacker will frequently try it.

### Step 2: Experiment

\[Find Injection Point\] Look for user controllable input, including HTTP headers, that can carry server side include directives to the web server.

- Use a spidering tool to follow and record all links. Make special note of any links that include parameters in the URL.
- Use a proxy tool to record all links visited during a manual traversal of the web application. Make special note of any links that include parameters in the URL. Manual traversal of this type is frequently necessary to identify forms that are GET method forms rather than POST forms.

### Step 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.

## Resources required

- None: No specialized resources are required to execute this type of attack. Determining whether the server supports SSI does not require special tools, and nor does injecting directives that get executed. Spidering tools can make the task of finding and following links easier.

## Consequences

| Scope | Impact | Note |
| --- | --- | --- |
| Confidentiality | Read Data | - |
| Confidentiality, Integrity, Availability | Execute Unauthorized Commands | Run Arbitrary Code |

## 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

## Example instances

Consider a website hosted on a server that permits Server Side Includes (SSI), such as Apache with the "Options Includes" directive enabled. Whenever an error occurs, the HTTP Headers along with the entire request are logged, which can then be displayed on a page that allows review of such errors. A malicious user can inject SSI directives in the HTTP Headers of a request designed to create an error. When these logs are eventually reviewed, the server parses the SSI directives and executes them.

## Related weaknesses (CWE)

- [CWE-20](https://radicalnotion.ai/cwe/cwe-20): Improper Input Validation
- [CWE-74](https://radicalnotion.ai/cwe/cwe-74): Improper Neutralization of Special Elements in Output Used by a Downstream Component
- [CWE-97](https://radicalnotion.ai/cwe/cwe-97): Improper Neutralization of Server-Side Includes (SSI) Within a Web Page

## Related attack patterns

| Relationship | CAPEC | Name |
| --- | --- | --- |
| Parent | [CAPEC-253](https://radicalnotion.ai/capec/capec-253) | Remote Code Inclusion |
| Can precede | [CAPEC-600](https://radicalnotion.ai/capec/capec-600) | Credential Stuffing |

## Taxonomy mappings

| Taxonomy | Entry | Id |
| --- | --- | --- |
| WASC | SSI Injection | 36 |
| OWASP Attacks | Server-Side Includes (SSI) Injection | - |

## Frequently asked questions

### What is CAPEC-101?

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.

### How does a Server Side Include (SSI) Injection attack work?

It typically unfolds over 3 phases. It begins with: \[Determine applicability\] The adversary determines whether server side includes are enabled on the target web server.

### How do you prevent CAPEC-101?

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

### What weaknesses does CAPEC-101 target?

CAPEC-101 exploits 3 CWE weaknesses: CWE-20 (Improper Input Validation), CWE-74 (Improper Neutralization of Special Elements in Output Used by a Downstream Component) and CWE-97 (Improper Neutralization of Server-Side Includes (SSI) Within a Web Page).

### How severe is CAPEC-101?

MITRE rates CAPEC-101 as High severity with high likelihood of attack.

Primary source: [MITRE CAPEC](https://capec.mitre.org/data/definitions/101.html)

---

Source: [RadicalNotion.AI](https://radicalnotion.ai/capec/capec-101). Licensed CC BY-NC 4.0; attribute RadicalNotion.AI and link the source page when you reuse this data.
