# GHSA-87pf-7x99-5xc4: Silverstripe Hostname, IP and Protocol Spoofing through HTTP Headers

> Attackers can spoof HTTP headers to bypass SSL enforcement and IP restrictions in SilverStripe, requiring configuration changes to mitigate.

- **Severity:** Not scored
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 23 May 2024

## What is GHSA-87pf-7x99-5xc4?

GHSA-87pf-7x99-5xc4 is a vulnerability in silverstripe/framework, published on 23 May 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

In it's default configuration, SilverStripe trusts all originating IPs to include HTTP headers for Hostname, IP and Protocol. This enables reverse proxies to forward requests while still retaining the original request information. Trusted IPs can be limited via the SS_TRUSTED_PROXY_IPS constant. Even with this restriction in place, SilverStripe trusts a variety of HTTP headers due to different proxy notations (e.g. X-Forwarded-For vs. Client-IP). Unless a proxy explicitly unsets invalid HTTP headers from connecting clients, this can lead to spoofing requests being passed through trusted proxies.

The impact of spoofed headers can include Director::forceSSL() not being enforced, SS_HTTPRequest->getIP() returning a wrong IP (disabling any IP restrictions), and spoofed hostnames circumventing any hostname-specific restrictions enforced in SilverStripe Controllers.

Regardless on running a reverse proxy in your hosting infrastructure, please follow the instructions on Secure Coding: Request hostname forgery in order to opt-in to these protections. If your website is not behind a reverse proxy, you might already be protected if using Apache with mod_env enabled, and you have the following line in your .htaccess file: SetEnv BlockUntrustedIPs true.

## Which versions are affected by GHSA-87pf-7x99-5xc4?

6 open source packages ship an affected version, including silverstripe/framework.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `silverstripe/framework` | Packagist | All versions | 3.1.17 |
| `silverstripe/framework` | Packagist | All versions | 3.1.17 |
| `silverstripe/framework` | Packagist | From 3.2.0 | 3.2.2 |
| `silverstripe/framework` | Packagist | From 3.2.0 | 3.2.2 |
| `silverstripe/framework` | Packagist | From 3.3.0-beta1 | 3.3.0 |
| `silverstripe/framework` | Packagist | From 3.3.0-beta1 | 3.3.0 |

## How do I fix GHSA-87pf-7x99-5xc4?

Upgrade silverstripe/framework to a fixed version for your release line: 3.1.17, 3.2.2 or 3.3.0.

## Is GHSA-87pf-7x99-5xc4 being exploited?

There is no known exploitation of GHSA-87pf-7x99-5xc4 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-87pf-7x99-5xc4 and fix it if it is affected.

What it is: GHSA-87pf-7x99-5xc4 is a vulnerability in silverstripe/framework, published on 23 May 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of GHSA-87pf-7x99-5xc4 in the wild and no public exploit code.

Affected packages and fixed versions:
- silverstripe/framework (Packagist): affected all versions; fixed in 3.1.17
- silverstripe/framework (Packagist): affected all versions; fixed in 3.1.17
- silverstripe/framework (Packagist): affected from 3.2.0; fixed in 3.2.2
- silverstripe/framework (Packagist): affected from 3.2.0; fixed in 3.2.2
- silverstripe/framework (Packagist): affected from 3.3.0-beta1; fixed in 3.3.0
- silverstripe/framework (Packagist): affected from 3.3.0-beta1; fixed in 3.3.0

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/GHSA-87pf-7x99-5xc4/ (Markdown: https://insights.sbomify.com/GHSA-87pf-7x99-5xc4/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-87pf-7x99-5xc4

---
From sbomify Insights: https://insights.sbomify.com/GHSA-87pf-7x99-5xc4/
Summaries are generated and may contain mistakes; the official description above is the record.
