Heuristic underlying TRUSTED_PROXY may be flawed.

24 views
Skip to first unread message

Patrick Nelson

unread,
Feb 12, 2016, 9:12:52 PM2/12/16
to silverst...@googlegroups.com
Just throwing this out there, in case anyone else thinks this may need to escalate to an issue/PR. I suppose this is currently already an issue, since by default this is enabled. However, I think it should be completely removed and all areas depending on it refactored.

Basically what I'm thinking is that, while for the moment it appears that the TRUSTED_PROXY constant is working pretty well in some situations (determining SSL status and IP address), what if the framework checks Client-IP first (which may be spoofed) while my actual proxy uses X-Forwarded-For (which the framework checks second)? There's nothing prevent a malicious client from crafting either of these. 

Therefore, I'm suggesting that proxy configuration should entail manual configuration not only of trusted IP's (already basically done) but also trusted headers, once the upstream proxy IP address is validated. Maybe be able to also configure which headers are trusted on a per-proxy basis (i.e. basically requiring this to be entirely YAML-based config).

What do y'all think?


- Patrick

Ingo Schommer

unread,
Feb 17, 2016, 5:22:21 AM2/17/16
to SilverStripe Core Development
Hey Patrick, you're onto something there - unless the proxy filters out these headers already, there's still some potential for spoofing. I've kicked off a discussion with the security team, you can expect a release soon. In the future, if you're unsure whether an issue is security related, please email secu...@silverstripe.org first before posting here :)
Reply all
Reply to author
Forward
0 new messages