IPB does what they can with sanitizing user requests. However in terms of someone spoofing headers… Some ways of preventing host header injections:
Validate Host headers
User input must always be considered unsafe and should be validated and sanitized first. One way to validate host headers, where needed, is to create a whitelist of permitted domains and check host headers in incoming requests against this list. Respectively, any hosts that are not recognized should be rejected or redirected.
To understand how to implement such a whitelist, see the relevant framework documentation.
When validating host headers, you must also establish whether the request came from the original target host or not.
Whitelist trusted domains
Already at the development stage, you should whitelist all trusted domain names from which your reverse proxy, load balancer, or other intermediary systems are allowed to forward requests. This will help you prevent routing-based attacks such as a Server-Side Request Forgery (SSRF).
Implement domain mapping
Map every origin server to which the proxy should serve requests, i.e., mapping hostnames to websites.
Reject override headers
Host override headers, such as X-Host and X-Forwarded-Host, are frequently used in header injections. Servers sometimes support these by default, so it’s essential to double-check that this is not the case.
Avoid using internal-only websites under a virtual host
Host headers injections can be used to access internal (private) domains. Avoid this scenario, do not host public and private websites on the same virtual host.
Create a dummy virtual host
If you use Apache or Nginx, you can create a dummy virtual host to capture requests from unrecognized host headers (i.e., forged requests) and prevent cache poisoning.
Fix your server configuration
Host header injections are frequently due to default settings, and faulty or old server configurations. Inspecting and fixing your server configuration can eliminate significant vulnerabilities that open the door for injections.