3 hours ago
Hello Railway Team,
We are developing Noctis, a privacy-focused application, and are currently blocked on the security acceptance of our staging environment.
Project: noctis-staging
Service: striking-smile
Our environment contains a single service, one public Railway HTTPS domain, no public TCP proxy, and an IPv4/IPv6 private endpoint.
We need a trustworthy client IP address for our server-side login rate limiter.
We have already confirmed that:
- PostgreSQL connectivity from the Railway container works.
- TLS certificate verification succeeds.
- The application receives a valid X-Real-IP header during an ordinary HTTPS request.
- The received IP matches srcIp in the Railway HTTP log for the same X-Railway-Request-Id.
However, before trusting this header for security-sensitive operations, we need clarification on the following platform guarantees:
-
Does Railway's public HTTPS ingress unconditionally overwrite a client-supplied X-Real-IP header?
-
How does Railway handle duplicate X-Real-IP headers, comma-separated values, and malformed IP addresses? Is the behavior consistent across HTTP/1.1 and HTTP/2?
-
Is the resulting X-Real-IP guaranteed to match srcIp in the corresponding Railway HTTP log?
-
Is there a supported way for an application to reliably distinguish requests originating from Railway's public ingress from direct private-network requests?
-
Which workloads can access a service's private endpoint? Can workloads from other environments, build containers, or ephemeral workloads reach it?
-
Is there a recommended secure configuration for implementing IP-based authentication rate limiting on Railway without introducing an additional external reverse proxy?
Our application currently fails closed when a trusted client IP cannot be established. Consequently, password and OTP authentication remain unavailable on staging.
We are not asking Railway to debug our application code. We specifically need clarification regarding Railway's networking and ingress security guarantees.
We would appreciate a response from the Railway engineering team distinguishing documented platform guarantees from current implementation behavior.
Thank you for your assistance.
1 Reply
3 hours ago
Our HTTP edge overwrites X-Real-IP, X-Forwarded-For, X-Forwarded-Proto and X-Forwarded-Host on every request it forwards. Incoming copies are replaced, not kept or appended to, so a caller can't set its own client IP by sending a forged X-Real-IP. The edge terminates TLS and forwards HTTP/1.1 to your app, converting HTTP/2 when needed. The value matches srcIp in the HTTP logs. One exception: when the request comes from Cloudflare's published IPv4 ranges and includes CF-Connecting-IP, both use that visitor address. Our public networking specifications note that these details can change.
Requests made directly over *.railway.internal don't go through the edge, so a private caller can send any forwarding headers it wants. We don't provide a signed header, an edge-only listener switch or an edge mTLS identity, so the header alone can't prove a request came through public ingress. We also don't publish stable ranges for the proxy socket addresses your container sees.
Private networks are isolated between projects and between environments. Any service in the same project and environment can reach your listening port, so the environment is the trust boundary (how private networking works).
For login rate limiting, you can use the edge-set X-Real-IP as long as you trust every workload that can reach your listener in that environment, and you account for any other ingress path, such as a TCP proxy. An IP address still doesn't identify a user, since people can change networks or use a VPN.
Status changed to Awaiting User Response Railway • about 3 hours ago