Full path disclosure at ads.twitter.com
The application disclosed a full server file path in an HTTP response header when a user uploaded a file. An attacker could use this path information to aid further attacks such as local file inclusion or remote code execution.
Originally disclosed on HackerOne
- Triaged in under an hour
- Fixed in 30 days
- Paid in 5 days
- Disclosed after 2 months
Hi there,
I noticed a small information disclosure (full path disclosure) on ads.twitter.com.
#Steps to reproduce
-
- Login to ads.twitter.com
-
- Start to create a new twitter-follower campaign
-
- Choose to upload a new picture
-
- Turn on your intercepting proxy
-
- Upload a file
-
- You should notice a request to your log facility.
GET /accounts/18ce53wparq/log?v=0.9&u=https%3A%2F%2Fads.twitter.com%2Faccounts%2Fxxxx%2Fcampaigns%2Fnew_objective%2Ffollowers%3Fsource%3Dobjective_picker&rt.start=cookie&r=https%3A%2F%2Fads.twitter.com%2Faccounts%2Fxxxxx%2Fcampaigns%2Fnew&timers=&events=ads%3Afollowers%3Acreative%3A%3A%3Aenter HTTP/1.1
Host: ads.twitter.com
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:32.0) Gecko/20100101 Firefox/32.0
Accept: image/png,image/*;q=0.8,*/*;q=0.5
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Referer: https://ads.twitter.com/accounts/xxxxx/campaigns/new_objective/followers?source=objective_picker
Cookie: [COOKIES]
Connection: keep-alive
The response will contain something like this:
x-sendfile: /var/lib/mesos/slaves/201403042312-2230002186-5050-50082-705/frameworks/201104070004-0000002563-0000/executors/thermos-1409696851527-revenue_web-prod-ads-36-d76baad3-5634-4141-ab52-478be9ecab97/runs/e09cc5ea-77f8-4729-afd1-0045b2a772c5/sandbox/app/assets/images/blank.gif
As you can see, this discloses a full path to a resource. This information could be used in furhter attack scenarios like LFI or RCE.
Please let me know what you think about it.
Best regards, Sebastian
Context
ads.twitter.com is the advertising interface where an advertiser builds and manages campaigns. One of the creative steps in a follower campaign is uploading an image. The report describes a full path disclosure that appears in the response headers of a logging request made by the page while the advertiser works through that upload flow.
The researcher, internetwache, reported it to the X / xAI program on HackerOne as an Information Disclosure issue. The report was disclosed on 2014-11-17 and a bounty of 140.00 USD was paid. No CVSS score or severity rating is given.
Setup
To reproduce the issue you need:
- An account that can log in to ads.twitter.com.
- The ability to create a new twitter-follower campaign.
- An intercepting proxy in front of the browser, so the requests the page makes can be inspected.
- A file to upload as the campaign picture.
The researcher used Firefox 32.0 on Linux x86_64, as shown in the User-Agent of the captured request.
Finding it
While creating a follower campaign and uploading a picture, the researcher watched the traffic through the proxy. Uploading the file causes the page to send a request to a logging endpoint on the same host. The response to that request carries an x-sendfile header whose value is an absolute filesystem path inside the application's deployment sandbox. That path is what the researcher considered the information disclosure: it reveals the server's internal directory layout to anyone who can see the response.
Exploitation
Step 1: Log in and start a follower campaign
Log in to ads.twitter.com and begin creating a new twitter-follower campaign.
Step 2: Choose to upload a new picture
In the creative step, select the option to upload a new picture.
Step 3: Turn on the intercepting proxy
Enable the proxy so the requests and responses between the browser and ads.twitter.com can be read.
Step 4: Upload a file and capture the logging request
Upload a file. Among the requests you should see one to the log facility:
GET /accounts/18ce53wparq/log?v=0.9&u=https%3A%2F%2Fads.twitter.com%2Faccounts%2Fxxxx%2Fcampaigns%2Fnew_objective%2Ffollowers%3Fsource%3Dobjective_picker&rt.start=cookie&r=https%3A%2F%2Fads.twitter.com%2Faccounts%2Fxxxxx%2Fcampaigns%2Fnew&timers=&events=ads%3Afollowers%3Acreative%3A%3A%3Aenter HTTP/1.1
Host: ads.twitter.com
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:32.0) Gecko/20100101 Firefox/32.0
Accept: image/png,image/*;q=0.8,*/*;q=0.5
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Referer: https://ads.twitter.com/accounts/xxxxx/campaigns/new_objective/followers?source=objective_picker
Cookie: [COOKIES]
Connection: keep-alive
The (https://ads.twitter.com/accounts/xxxx/campaigns/new_objective/followers?source=objective_picker), (https://ads.twitter.com/accounts/xxxxx/campaigns/new), The Accept header asks for an image. The account identifiers in the path and in the u and r parameters are shown as 18ce53wparq and xxxx/xxxxx in the report.
Step 5: Read the response header
The response to that request contains a header like this:
x-sendfile: /var/lib/mesos/slaves/201403042312-2230002186-5050-50082-705/frameworks/201104070004-0000002563-0000/executors/thermos-1409696851527-revenue_web-prod-ads-36-d76baad3-5634-4141-ab52-478be9ecab97/runs/e09cc5ea-77f8-4729-afd1-0045b2a772c5/sandbox/app/assets/images/blank.gif
The value is an absolute path on the server's filesystem. It exposes the Mesos slave directory structure and the application's sandbox location, ending at app/assets/images/blank.gif. The researcher's point is that this discloses a full path to a resource.
Root cause
The report does not analyse the code. What the response shows is that the logging endpoint answers with an x-sendfile header pointing at a static file (blank.gif) inside the application sandbox, and that the header is returned to the client rather than being consumed only by the web server. x-sendfile is a mechanism where the application tells the web server which file to serve; the path is normally internal and should not reach the browser. The response shows the header reaching the client rather than being consumed only by the web server. The report does not say why existing defences did not catch it.
Impact
The disclosed value is a server-side absolute path, including deployment and orchestration directory names. The researcher states that this information could be used in further attack scenarios such as LFI or RCE. That is a hedge: the report demonstrates the disclosure only, not any follow-on exploitation. In the described flow the exposure is to an authenticated advertiser going through the campaign creation and picture upload steps.
Fix
The report does not describe a fix or a verification of one. What should change is that the x-sendfile header, and any other header carrying internal filesystem paths, is not returned to the client; the web server should consume it internally, or the endpoint should serve the blank image without exposing the path.
Variants to test
- Other logging or beacon endpoints. Look for requests the page fires automatically (analytics, timing, event logging) and inspect every response header. A positive result is any header whose value is an absolute path such as
/var/...,/home/...or a container/sandbox path. - Static asset responses. Request images, scripts and styles referenced by the application and check for
x-sendfile,x-accel-redirector similar headers. A positive result is a path that reveals deployment directories or identifiers. - Error responses. Trigger errors on endpoints that serve files and inspect the body and headers. A positive result is a stack trace or path in the response.
- Different upload and creative flows. Repeat the upload step in other campaign types and check the accompanying logging traffic. A positive result is the same path disclosure in a different feature.
Hunting notes
This kind of bug hides in the background traffic a page generates on its own: logging, timing and analytics beacons, and static file responses. During recon, watch the proxy or browser developer tools for requests you did not consciously make, especially ones with an Accept header for an image, and read their response headers rather than only the body. The signal is a header value that looks like a server filesystem path.
What happened, in plain words
ads.twitter.com is the website where advertisers create and manage advertising campaigns on Twitter (now X). One of the steps in building a campaign is uploading a picture. While doing that, the page quietly sends a small background request to a logging service on the same site. The response to that request includes a header that reveals the full folder path of a file on the server, for example /var/lib/mesos/.../app/assets/images/blank.gif. That kind of leak is called a full path disclosure: it tells an outsider how the server's files and folders are arranged, which can help in later attacks. The researcher, internetwache, reported it to the X / xAI program on HackerOne as an Information Disclosure issue. The report was disclosed on 2014-11-17 and a bounty of 140.00 USD was paid. No CVSS score or severity rating is given.
Setup
To reproduce the issue you need:
- An account that can log in to ads.twitter.com.
- The ability to create a new twitter-follower campaign.
- An intercepting proxy in front of the browser, so the requests the page makes can be inspected.
- A file to upload as the campaign picture.
The researcher used Firefox 32.0 on Linux x86_64, as shown in the User-Agent of the captured request.
An intercepting proxy is a tool that sits between your browser and the website and lets you read every request and response. Think of it as a transparent mail sorter: you still send and receive letters, but you can open each envelope and read what is inside before it moves on.
Finding it
While creating a follower campaign and uploading a picture, the researcher watched the traffic through the proxy. Uploading the file causes the page to send a request to a logging endpoint on the same host. The response to that request carries an x-sendfile header whose value is an absolute filesystem path inside the application's deployment sandbox. That path is what the researcher considered the information disclosure: it reveals the server's internal directory layout to anyone who can see the response.
Exploitation
Step 1: Log in and start a follower campaign
Log in to ads.twitter.com and begin creating a new twitter-follower campaign.
Step 2: Choose to upload a new picture
In the creative step, select the option to upload a new picture.
Step 3: Turn on the intercepting proxy
Enable the proxy so the requests and responses between the browser and ads.twitter.com can be read.
Why this step: the leak is in a response header, not in the visible page. A proxy lets you see the raw headers that the browser normally hides.
Step 4: Upload a file and capture the logging request
Upload a file. Among the requests you should see one to the log facility:
GET /accounts/18ce53wparq/log?v=0.9&u=https%3A%2F%2Fads.twitter.com%2Faccounts%2Fxxxx%2Fcampaigns%2Fnew_objective%2Ffollowers%3Fsource%3Dobjective_picker&rt.start=cookie&r=https%3A%2F%2Fads.twitter.com%2Faccounts%2Fxxxxx%2Fcampaigns%2Fnew&timers=&events=ads%3Afollowers%3Acreative%3A%3A%3Aenter HTTP/1.1
Host: ads.twitter.com
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:32.0) Gecko/20100101 Firefox/32.0
Accept: image/png,image/*;q=0.8,*/*;q=0.5
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Referer: https://ads.twitter.com/accounts/xxxxx/campaigns/new_objective/followers?source=objective_picker
Cookie: [COOKIES]
Connection: keep-alive
Line by line:
GET /accounts/18ce53wparq/log?v=0.9&... HTTP/1.1is the request line.GETmeans the browser is asking to fetch something. The path/accounts/18ce53wparq/logis the logging endpoint, and18ce53wparqis an account identifier shown in the report. Everything after?is the query string, a set of parameters sent along with the request.HTTP/1.1is the version of the protocol.v=0.9is a parameter in the query string.u=https%3A%2F%2Fads.twitter.com%2Faccounts%2Fxxxx%2Fcampaigns%2Fnew_objective%2Ffollowers%3Fsource%3Dobjective_pickeris a URL-encoded value; decoded, it ishttps://ads.twitter.com/accounts/xxxx/campaigns/new_objective/followers?source=objective_picker. URL encoding replaces characters like:and/with%3Aand%2Fso they can travel safely inside a query string. Decoded, it ishttps://ads.twitter.com/accounts/xxxx/campaigns/new_objective/followers?source=objective_picker.r=https%3A%2F%2Fads.twitter.com%2Faccounts%2Fxxxxx%2Fcampaigns%2Fnewis a URL-encoded value, decoded ashttps://ads.twitter.com/accounts/xxxxx/campaigns/new.rt.start=cookieis a parameter in the query string.events=ads%3Afollowers%3Acreative%3A%3A%3Aenteris a parameter; decoded, the%3Acharacters become colons, givingads:followers:creative:::enter. Decoded, the%3Acharacters become colons, givingads:followers:creative:::enter.Host: ads.twitter.comis the Host header value.User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:32.0) Gecko/20100101 Firefox/32.0identifies the browser and operating system: Firefox 32.0 on Linux x86_64.Accept: image/png,image/*;q=0.8,*/*;q=0.5says the browser prefers an image in response. The browser prefers an image in response.Accept-Language: en-US,en;q=0.5is the Accept-Language header value.Accept-Encoding: gzip, deflateis the Accept-Encoding header value.Referer: https://ads.twitter.com/accounts/xxxxx/campaigns/new_objective/followers?source=objective_pickeris the Referer header value.Cookie: [COOKIES]is the Cookie header value.Connection: keep-aliveis the Connection header value.
The account identifiers in the path and in the u and r parameters are shown as 18ce53wparq and xxxx/xxxxx in the report.
Step 5: Read the response header
The response to that request contains a header like this:
x-sendfile: /var/lib/mesos/slaves/201403042312-2230002186-5050-50082-705/frameworks/201104070004-0000002563-0000/executors/thermos-1409696851527-revenue_web-prod-ads-36-d76baad3-5634-4141-ab52-478be9ecab97/runs/e09cc5ea-77f8-4729-afd1-0045b2a772c5/sandbox/app/assets/images/blank.gif
Line by line:
x-sendfile:is the name of the header. Normally this header is internal: the application passes it to the web server, and the web server reads the file and sends its contents to the browser. The browser should not see the header itself.- The value is an absolute path on the server's filesystem. It starts at
/var/lib/mesos/slaves/..., which exposes the Mesos slave directory structure. Mesos is a cluster manager that runs tasks across a group of machines. frameworks/201104070004-0000002563-0000andexecutors/thermos-1409696851527-revenue_web-prod-ads-36-d76baad3-5634-4141-ab52-478be9ecab97are directory names in the path.runs/e09cc5ea-77f8-4729-afd1-0045b2a772c5is a directory in the path.sandbox/app/assets/images/blank.gifis the end of the path, pointing atblank.gif.
The researcher's point is that this discloses a full path to a resource.
Root cause
The report does not analyse the code. What the response shows is that the logging endpoint answers with an x-sendfile header pointing at a static file (blank.gif) inside the application sandbox, and that the header is returned to the client rather than being consumed only by the web server. x-sendfile is a mechanism where the application tells the web server which file to serve; the path is normally internal and should not reach the browser. The response shows the header reaching the client rather than being consumed only by the web server. The report does not say why existing defences did not catch it.
Impact
The disclosed value is a server-side absolute path, including deployment and orchestration directory names. The researcher states that this information could be used in further attack scenarios such as LFI or RCE. That is a hedge: the report demonstrates the disclosure only, not any follow-on exploitation. In the described flow the exposure is to an authenticated advertiser going through the campaign creation and picture upload steps.
LFI (local file inclusion) is a class of bug where an attacker tricks a server into including a file from its own filesystem. RCE (remote code execution) means running the attacker's code on the server. Knowing the exact folder layout can make such attacks easier, but the report does not show either of them happening.
Fix
What should change is that the x-sendfile header, and any other header carrying internal filesystem paths, is not returned to the client; the web server should consume it internally, or the endpoint should serve the blank image without exposing the path.
Variants to test
- Other logging or beacon endpoints. Look for requests the page fires automatically (analytics, timing, event logging) and inspect every response header. A positive result is any header whose value is an absolute path such as
/var/...,/home/...or a container/sandbox path. - Static asset responses. Request images, scripts and styles referenced by the application and check for
x-sendfile,x-accel-redirector similar headers. A positive result is a path that reveals deployment directories or identifiers. - Error responses. Trigger errors on endpoints that serve files and inspect the body and headers. A positive result is a stack trace or path in the response.
- Different upload and creative flows. Repeat the upload step in other campaign types and check the accompanying logging traffic. A positive result is the same path disclosure in a different feature.
Hunting notes
This kind of bug hides in the background traffic a page generates on its own: logging, timing and analytics beacons, and static file responses. During recon, watch the proxy or browser developer tools for requests you did not consciously make, especially ones with an Accept header for an image, and read their response headers rather than only the body. The signal is a header value that looks like a server filesystem path.
Glossary
- Slave: a Mesos agent, a machine that offers its resources to the cluster and runs tasks.
- Framework: in Mesos, a scheduler and its executors registered with the cluster.
- Executor: in Mesos, a process launched on an agent that runs a framework's tasks.
- Sandbox: in Mesos, the working directory created on an agent for an executor.