Client IP Spoofing using "X-Forwarded-For: 127.0.0.1" on "studio-app.snapchat.com" exposing bucket details
The researcher found that adding an X-Forwarded-For header with the value [redacted] to requests for a specific path on a Snapchat service exposed non-sensitive configuration details about the underlying bucket. An attacker could view this information by spoofing the client IP to appear as localhost.
- Triaged in 27 hours
- Fixed in 7 months
- Paid in 3 months
- Disclosed after 3.1 years
Summary by the program
Researcher's summary is accurate. An attacker could view a variety of non-sensitive service config information by setting the X-Forwarded-For: 127.0.0.1 header on a specific service path.
Summary by the researcher
By adding "X-Forwarded-For: 127.0.0.1" as a header while requesting a certain path on a certain snapchat resource, an attacker was able to (non-sensitive) details about the underlying system/bucket.
What the report shows
The target is studio-app.snapchat.com, a Snapchat resource. The researcher, damian89, found that adding a particular header to a request for a certain path on that host returned details about the underlying system and the bucket behind it. The program's own summary describes the exposed information as a variety of non-sensitive service configuration details, and the researcher likewise characterises the details as non-sensitive.
The whole technique is the header value:
X-Forwarded-For: [redacted]
The researcher sent this header while requesting a specific path on the host. The report does not name the path, the full request, the response body, or the exact configuration fields that came back. What it does say is that adding the header returned details about the underlying system and bucket.
Step by step, as the report describes it:
- Identify a path on
studio-app.snapchat.comthat behaves differently depending on the apparent client address. - Add
X-Forwarded-For: [redacted]to the request for that path. - Observe that the response now includes details about the underlying system and bucket that are not normally exposed.
The program accepted the finding, rated it high severity under the weakness category Improper Access Control - Generic, and paid a bounty of 500.00 USD. The report was disclosed on 2021-08-12. The text does not describe a fix, and it does not give a CVSS score.
Root cause
A plausible explanation is that the application trusts the X-Forwarded-For header as a source of the client's address and uses it for an access-control decision. Because the header is supplied by the client, anyone can claim to be [redacted]. The response included configuration information about the service and its storage bucket. The trust boundary is misplaced: a value that the client controls is treated as if it came from the network layer.
Impact
The report is careful about scope. The exposed data is described as non-sensitive service configuration information and details about the underlying system and bucket. The program rated it high under Improper Access Control - Generic, and the report does not claim that credentials, user data or write access were obtained. In practice, configuration and bucket details are useful to an attacker as reconnaissance: they can reveal how the service is wired and where to look next. The report stops at disclosure of that information.
How this kind of bug works
Proxies and load balancers commonly append or set forwarding headers so that the backend knows the original client address. The conventional headers are X-Forwarded-For, X-Real-IP, Forwarded, and vendor-specific variants such as CF-Connecting-IP or True-Client-IP. The backend is supposed to read the client address from the connection, or from a header that the trusted proxy overwrote, never from a value the client sent through untouched.
The bug appears when two conditions meet. First, the application makes a security decision based on the apparent client address, for example allowing access to internal endpoints, debug output or admin functions only for loopback or private ranges. Second, the header carrying that address is not sanitised or overwritten before the application reads it. A client that sets the header to [redacted], ::1, [redacted] or a similar internal address then inherits the trust given to those addresses.
Defences are straightforward in principle. The edge proxy should strip any client-supplied forwarding headers and set its own, and the application should only trust forwarding headers from known proxy addresses. Access control should not depend on the source address at all where possible, and internal-only functionality should sit on a separate listener or network path rather than behind an address check.
How to test for it
Look for endpoints whose behaviour plausibly depends on where the request comes from: health and status pages, debug or metrics endpoints, admin panels, internal APIs, storage or bucket metadata, and anything that returns configuration. These often sit on the same host as the public application.
A practical method:
- Request the candidate path normally and record the status code, length and body.
- Repeat the request with a forwarding header set to a loopback address, then to private ranges, and compare.
- Try the common header names, since the application may read only one of them.
- If a single header has no effect, try combinations, and try placing the value in different positions in a comma-separated list, because some stacks read the first entry and others the last.
- Confirm the difference is caused by the header and not by caching, by repeating both requests and varying only the header.
A positive result is a response that differs materially: new fields, a different status code, or content that is clearly internal. Common false positives include cached responses, a generic error page that changes length for unrelated reasons, and endpoints that return the same public data regardless of the header. Always check that the sensitive content is genuinely not available without the header.
How it is fixed
- Strip client-supplied forwarding headers at the edge and set them from the actual connection.
- Configure the application to trust forwarding headers only from known proxy addresses.
- Remove address-based access control for internal functionality; use authentication and authorisation instead.
- Keep internal endpoints off the public listener entirely.
- Review any code that branches on loopback or private ranges and confirm the address cannot be influenced by the client.
Hunting notes
This class tends to hide where internal tooling shares a host or load balancer with the public product: status and metrics paths, storage metadata, and admin routes that were never meant to be reachable. Recon signals include hosts that return different content for internal addresses, error messages mentioning buckets or backends, and applications built on frameworks whose default behaviour trusts proxy headers.
To make a report land, show the before and after clearly: the request without the header, the request with it, and the specific fields that appear only in the second case. Explain why those fields matter, and be honest about sensitivity, as this report was. A precise, reproducible difference is far more convincing than a claim that an endpoint is internal.
What happened, in plain words
This report is about a Snapchat web resource at studio-app.snapchat.com. The researcher, damian89, found that a request to a certain path on that host could be made to reveal details about the system behind it and about a storage bucket. The program's summary calls the exposed information "a variety of non-sensitive service config information", and the researcher also describes it as non-sensitive.
To understand the trick, you need two ideas. First, a request is what your browser sends to a server when you open a page or click a link: a line saying which path you want, plus a set of headers, which are small labelled values carrying extra information (your browser type, what formats you accept, and so on). Second, a header is just a name and a value, like a label on an envelope. Servers read these labels to decide how to answer.
One header that servers often look at is X-Forwarded-For. Websites usually sit behind a proxy or load balancer, a middle machine that receives visitors' requests and passes them on to the actual application server. Because the application then sees the proxy's address rather than the visitor's, the proxy adds X-Forwarded-For to record the real visitor address. The application is supposed to trust that header only when it comes from the proxy.
The whole technique in this report is one header value:
X-Forwarded-For: [redacted]
Line by line: X-Forwarded-For is the header name, the colon separates name from value, and [redacted] is the loopback address, a special address that always means "this same machine". When a program connects to [redacted], it is talking to itself, not across the network. Many systems treat traffic from that address as coming from the machine itself, and therefore as more trustworthy than traffic from the internet.
The researcher sent this header while requesting a specific path on studio-app.snapchat.com. The response included details about the underlying system and its bucket. A bucket is a container for stored files in cloud storage services; its details can describe how the service is put together.
Step by step, as the report describes it:
- Find a path on
studio-app.snapchat.comwhose answer changes depending on where the request appears to come from. - Add
X-Forwarded-For: [redacted]to the request for that path. - Notice that the response now includes details about the underlying system and bucket that are not normally shown.
The report does not name the path, the full request, the response body, or the exact configuration fields that came back. It also does not describe a fix and gives no CVSS score. The program accepted the finding, rated it high severity under the category Improper Access Control - Generic, and paid a bounty of 500.00 USD. It was disclosed on 2021-08-12.
Why does this matter if the data is non-sensitive? Because configuration and bucket details are useful for reconnaissance: they tell an attacker how a service is wired and where to look next. The report is careful to stop there and does not claim that credentials, user data or write access were obtained.
In general, how this kind of bug works
A likely explanation is a misplaced trust boundary: a value the client controls is treated as if it came from the network layer. The application may read the client address from X-Forwarded-For and use it to decide whether to grant access. Since anyone can type any value into a header, anyone can claim to be [redacted].
Proxies and load balancers commonly set forwarding headers so the backend knows the original client address. The usual names are X-Forwarded-For, X-Real-IP, Forwarded, and vendor variants such as CF-Connecting-IP or True-Client-IP. The backend should take the client address from the connection itself, or from a header that a trusted proxy has overwritten, never from a value the client sent through untouched.
The bug appears when two conditions meet:
- The application makes a security decision based on the apparent client address, for example allowing internal pages, debug output or admin functions only for loopback or private addresses.
- The header carrying that address is not cleaned or overwritten before the application reads it.
A client that sets the header to [redacted], ::1, [redacted] or a similar internal address then inherits the trust given to those addresses. ::1 is the loopback address in the newer IPv6 format, and [redacted] is an example of a private address used inside internal networks.
Defences are simple in principle. The edge proxy should strip any client-supplied forwarding headers and set its own, and the application should trust forwarding headers only from known proxy addresses. Access control should not depend on the source address where possible, and internal-only features should sit on a separate listener or network path rather than behind an address check.
In general, how to test for it
Look for endpoints whose behaviour plausibly depends on where the request comes from: health and status pages, debug or metrics endpoints, admin panels, internal APIs, storage or bucket metadata, and anything that returns configuration. These often sit on the same host as the public application.
A practical method:
- Request the candidate path normally and record the status code, length and body. The status code is the three-digit number a server returns, such as 200 for success or 403 for forbidden.
- Repeat the request with a forwarding header set to a loopback address, then to private ranges, and compare.
- Try the common header names, since the application may read only one of them.
- If a single header has no effect, try combinations, and try placing the value in different positions in a comma-separated list, because some stacks read the first entry and others the last.
- Confirm the difference is caused by the header and not by caching, by repeating both requests and varying only the header. Caching means a server or browser reusing a stored copy of an earlier response.
A positive result is a response that differs materially: new fields, a different status code, or content that is clearly internal. Common false positives include cached responses, a generic error page that changes length for unrelated reasons, and endpoints that return the same public data regardless of the header. Always check that the sensitive content is genuinely not available without the header.
In general, how it is fixed
- Strip client-supplied forwarding headers at the edge and set them from the actual connection.
- Configure the application to trust forwarding headers only from known proxy addresses.
- Remove address-based access control for internal functionality; use authentication and authorisation instead.
- Keep internal endpoints off the public listener entirely.
- Review any code that branches on loopback or private ranges and confirm the address cannot be influenced by the client.
In general, hunting notes
This class tends to hide where internal tooling shares a host or load balancer with the public product: status and metrics paths, storage metadata, and admin routes that were never meant to be reachable. Signals worth watching include hosts that return different content for internal addresses, error messages mentioning buckets or backends, and applications built on frameworks whose default behaviour trusts proxy headers.
To make a report land, show the before and after clearly: the request without the header, the request with it, and the specific fields that appear only in the second case. Explain why those fields matter, and be honest about sensitivity, as this report was. A precise, reproducible difference is far more convincing than a claim that an endpoint is internal.
Glossary
- Request: the message a browser sends to a server asking for a page or resource.
- Header: a named value attached to a request or response carrying extra information.
- Proxy / load balancer: a middle machine that receives requests and passes them on to the application server.
- X-Forwarded-For: a header used to record the original client address when a proxy forwards a request.
- Loopback address: a special address (
[redacted], or::1in IPv6) that always refers to the same machine. - Bucket: a container for stored files in a cloud storage service.
- Trust boundary: the line between data you control and data you trust; bugs happen when client-controlled data is trusted.
- Access control: the rules deciding who may see or do what.
- Improper Access Control - Generic: the weakness category the program assigned to this finding.
- Reconnaissance: gathering information about a system to plan further steps.
- Status code: the three-digit number a server returns to describe the outcome of a request.
- Caching: storing a copy of a response so it can be reused later.
- False positive: a result that looks like a bug but is not.
- CVSS: a scoring system for rating the severity of vulnerabilities.