VDB
Sign up
MEDIUM6.5

GHSA-87pf-7x99-5xc4

Silverstripe Hostname, IP and Protocol Spoofing through HTTP Headers

Quick fix

GHSA-87pf-7x99-5xc4 — silverstripe/framework: upgrade to the fixed version with the command below.

composer require silverstripe/framework:^3.1.17

Details

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.

Are you affected?

Enter the version of the package you're using.

Affected packages

Packagist/silverstripe/framework
Introduced in: 0Fixed in: 3.1.17
Fixcomposer require silverstripe/framework:^3.1.17
Packagist/silverstripe/framework
Introduced in: 3.2.0Fixed in: 3.2.2
Fixcomposer require silverstripe/framework:^3.2.2
Packagist/silverstripe/framework
Introduced in: 3.3.0-beta1Fixed in: 3.3.0
Fixcomposer require silverstripe/framework:^3.3.0

References

Check it before you install it

One call answers whether to add this package: known advisories, CISA KEV, and whether the name is a hallucinated or freshly squatted one. No key needed to try it.

curl -s https://vdb.ai.kr/v1/ai/check-packages \
  -H 'Content-Type: application/json' \
  -d '{"packages":["pkg:composer/silverstripe/framework"]}'