Takeover qsurvey.mozilla.com / Multiple Vulnerabilities
The report claims that the qsurvey.mozilla.com subdomain, which points to a third-party survey service, allows an attacker to create arbitrary content and host it under the Mozilla subdomain. An attacker could use this to host fake login forms or phishing pages that appear to be part of Mozilla.
- Fixed in 26 hours
- Paid in 11 days
- Disclosed after 26 hours
Created attachment 8884035 qsurvey-mozilla-com.png
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_5) AppleWebKit/603.2.4 (KHTML, like Gecko) Version/10.1.1 Safari/603.2.4
Steps to reproduce:
DESCRIPTION
Hi team, i found some issues at SG (survey gizmo) who permit an attacker create arbitrary content and use qsurvey.mozilla.com subdomain as own.
REPRODUCTION STEPS & POC
*ISSUE1
TAKEOVERS
LINK POC #1
- Go to http://qsurvey.mozilla.com//s3/3684742/8f95c5a8a547
- You see the arbitrary content injected
LINK POC #2
- Go to http://qsurvey.mozilla.com//s3/3684742/Hacked-by-Ak1t4
- You see the arbitrary content injected
*ISSUE 2
DOWNLOAD ARBITRARY FILE / EVIL CONTENT INJECTION
Vulnerable Link #1
- Go to http://qsurvey.mozilla.com/pro/html2pdf/generateArticlePdf.php?article_content=http://qsurvey.mozilla.com//s3/3684742/Hacked-by-Ak1t4
- Open document and click on link [CLICK-ME]
Vulnerable Link #2 http://qsurvey.mozilla.com/pro/html2pdf/generateapple_landscape.php?URL=https://www.surveygizmo.com/s3/3684742/Hacked-by-Ak1t4 2) Open document and click on link [CLICK-ME]
ADDITIONAL INFO
*ATTACK VARIATIONS
http://qsurvey.mozilla.com//s3/3684742/Hacked-by-Ak1t4
http://qsurvey.mozilla.com//s3/3684742/8f95c5a8a547
http://qsurvey.mozilla.com///s3/3684742/Hacked-by-Ak1t4
http://qsurvey.mozilla.com//s3/3684742/8f95c5a8a547
http://qsurvey.mozilla.com//\s3/3684742/Hacked-by-Ak1t4
http://qsurvey.mozilla.com//s3/3684742/8f95c5a8a547
http://qsurvey.mozilla.com///\s3/3684742/Hacked-by-Ak1t4
SECURITY IMPACT
This issues impact directly in mozilla survey's user. An attacker can utilize this issues with malicious purposes, targeting the organization by fake login forms, spread phishing, steal sensitive Users information (site accounts, steal credentials, cookies, credit card information, etc)
FIX & MITIGATION
*Contact vendor asap for patch or launch a Fix (surveygizmo.com)
Please let me know if more info needed or any help for fix this asap.
Best Regards, @ak1t4
Context
qsurvey.mozilla.com is a Mozilla subdomain that fronts SurveyGizmo (SG), a third-party survey platform. The report describes two problems on that host: a path handling issue that lets an attacker serve arbitrary content under the Mozilla subdomain, and a pair of PHP endpoints under /pro/html2pdf/ that generate PDFs from a caller-supplied URL or article body. The researcher's stated goal was to show that an attacker could create arbitrary content and use qsurvey.mozilla.com as their own.
Setup
The only environment detail given is the browser used to reproduce the issues:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_5) AppleWebKit/603.2.4 (KHTML, like Gecko) Version/10.1.1 Safari/603.2.4
No accounts, roles or tooling are described. The reproduction is a set of URLs to open in a browser, plus a screenshot attached to the report as qsurvey-mozilla-com.png.
Finding it
The researcher reports finding issues at SurveyGizmo that allow an attacker to create arbitrary content and use the qsurvey.mozilla.com subdomain as their own. The two proof-of-concept paths both point at the same SurveyGizmo survey identifier, 3684742, reached through the Mozilla host with a doubled slash before the /s3/ path segment. The second issue is a set of PHP scripts under /pro/html2pdf/ that take the content to render from request parameters.
Exploitation
Step 1: arbitrary content through the doubled slash (POC #1)
Open the following URL:
http://qsurvey.mozilla.com//s3/3684742/8f95c5a8a547
The researcher states that the arbitrary content is injected and rendered. The path uses //s3/ rather than /s3/, and the trailing segment is 8f95c5a8a547.
Step 2: arbitrary content with an attacker-chosen string (POC #2)
Open the following URL:
http://qsurvey.mozilla.com//s3/3684742/Hacked-by-Ak1t4
Again the researcher states that arbitrary content is injected. Here the trailing segment is a string chosen by the attacker.
Step 3: PDF generation from a remote article URL (Vulnerable Link #1)
Open the following URL:
http://qsurvey.mozilla.com/pro/html2pdf/generateArticlePdf.php?article_content=http://qsurvey.mozilla.com//s3/3684742/Hacked-by-Ak1t4
The article_content parameter carries the same attacker-controlled URL from step 2. The researcher then says to open the resulting document and click the link labelled [CLICK-ME].
Step 4: PDF generation from a remote URL (Vulnerable Link #2)
Open the following URL:
http://qsurvey.mozilla.com/pro/html2pdf/generateapple_landscape.php?URL=https://www.surveygizmo.com/s3/3684742/Hacked-by-Ak1t4
This second script, generateapple_landscape.php, takes the target in a parameter named URL, and the value points at the SurveyGizmo host rather than the Mozilla host. As in step 3, the researcher says to open the document and click the [CLICK-ME] link.
Attack variations
The report lists further spellings of the same path:
http://qsurvey.mozilla.com//s3/3684742/Hacked-by-Ak1t4
http://qsurvey.mozilla.com//s3/3684742/8f95c5a8a547
http://qsurvey.mozilla.com///s3/3684742/Hacked-by-Ak1t4
http://qsurvey.mozilla.com//s3/3684742/8f95c5a8a547
http://qsurvey.mozilla.com//\s3/3684742/Hacked-by-Ak1t4
http://qsurvey.mozilla.com//s3/3684742/8f95c5a8a547
http://qsurvey.mozilla.com///\s3/3684742/Hacked-by-Ak1t4
The variants mix two and three leading slashes and insert a backslash before s3. The report does not state which of these variants were confirmed to render content; they are presented as variations of the same attack.
Root cause
The report does not analyse the server-side code. What it shows is that a request path containing //s3/ (and the listed slash and backslash variants) is resolved to SurveyGizmo's /s3/ content path while the browser still treats the response as belonging to qsurvey.mozilla.com. The report does not explain why the doubled separator resolves to SurveyGizmo's content path. The PDF scripts are a separate issue: generateArticlePdf.php and generateapple_landscape.php take the content source from the query string (article_content and URL respectively).
Impact
The researcher states that the issues impact Mozilla survey users directly. An attacker can use them for malicious purposes: targeting the organisation with fake login forms, spreading phishing, and stealing sensitive user information such as site accounts, credentials, cookies and credit card information.
Fix
The report's only recommendation is to contact the vendor as soon as possible for a patch or to launch a fix, naming surveygizmo.com.
Variants to test
- Send a doubled or tripled slash before a known content path on other hosts that proxy a third-party platform, for example
//s3/<id>/<string>. A positive result is a response served under the target hostname whose body reflects the trailing string. - Insert a backslash before the path segment, as in
//\s3/...and///\s3/.... A positive result is the same reflected content, showing that the normalisation also mishandles backslashes. - Look for PDF or document generators that take a URL or body from the query string, such as
article_contentorURL. A positive result is a generated document containing a link to the supplied value. - Try the same parameter names on other endpoints of the same generator family, since the report shows two scripts (
generateArticlePdf.phpandgenerateapple_landscape.php) with different parameter names.
Hunting notes
This kind of bug tends to sit where a first-party hostname fronts a third-party SaaS product, because the proxy layer has to reconcile two path conventions. During recon, a subdomain whose content is clearly served by an external platform is the signal; a doubled slash in a working URL is the confirmation to look for. The researcher showed the attacker-chosen string in the URL and referenced it from the PDF generator URLs. The report does not record a severity, CVSS score or bounty amount.
What happened, in plain words
Mozilla runs a survey subdomain, qsurvey.mozilla.com. The actual survey software behind it is not written by Mozilla: it is a product called SurveyGizmo (the report shortens it to SG), a third-party service that hosts surveys for other companies. Mozilla's subdomain is a friendly front door to that service.
The researcher, ak1t4, found two problems on that front door. The first is a path handling trick: by putting an extra slash in the address, you can make the Mozilla subdomain serve content that the attacker chose, such as a page saying "Hacked-by-Ak1t4". The second is a pair of scripts under /pro/html2pdf/ that build PDF documents from a web address you hand them in the URL.
Why does this matter? A link that starts with qsurvey.mozilla.com looks trustworthy to a normal person. If an attacker can put their own page there, they can build a fake login form, ask for a password, or spread phishing. That is phishing, and it is the impact the researcher describes.
This article walks through the report step by step, in the order the researcher presented it, and explains every term along the way.
The setup
The only environment detail in the report is the browser used to reproduce the issues:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_5) AppleWebKit/603.2.4 (KHTML, like Gecko) Version/10.1.1 Safari/603.2.4
This is a User Agent string. Every time your browser asks a website for a page, it sends a short line of text describing itself: which browser, which version, which operating system. Websites use it to decide how to format pages. Here it tells us the researcher was on a Mac running macOS 10.12.5 and using Safari 10.1.1. That is all it means; it is not part of the attack.
No accounts, no special tools and no scripts are described. The whole reproduction is a list of web addresses to open in a browser, plus one screenshot attached to the report under the name qsurvey-mozilla-com.png. The report does not include that image in the text, so there is nothing to show here.
Finding it
The researcher says they found issues at SurveyGizmo that let an attacker create arbitrary content and use the qsurvey.mozilla.com subdomain as their own. "Arbitrary content" means content the attacker decides on, not content Mozilla or SurveyGizmo published.
Both proof-of-concept addresses point at the same SurveyGizmo survey identifier, 3684742, and both reach it through the Mozilla host with a doubled slash before the /s3/ part of the path. The second issue is a set of PHP scripts under /pro/html2pdf/ that take the content to render from parameters in the request.
A quick word on the pieces:
- Subdomain: the part in front of the main domain. In
qsurvey.mozilla.com,qsurveyis the subdomain andmozilla.comis the domain. Companies often point subdomains at external services. - Path: the part of a URL after the hostname, such as
/s3/3684742/.... It tells the server which resource you want. - PHP: a programming language commonly used to build web pages and scripts on the server side. Files ending in
.phpare scripts the server runs before sending a response. - Parameter: a name and value pair after a
?in a URL, such as?name=value. The server reads these to decide what to do. Think of it as the options you tick on an order form.
Exploitation
Step 1: arbitrary content through the doubled slash (POC #1)
Open this address in a browser:
http://qsurvey.mozilla.com//s3/3684742/8f95c5a8a547
Line by line:
http://is the protocol, the set of rules for fetching a web page. It is the unencrypted version;https://would be the encrypted one.qsurvey.mozilla.comis the host, the Mozilla subdomain that fronts SurveyGizmo.//s3/is the interesting part. A normal path would start with a single/. Here there are two. Servers and proxies sometimes tidy up paths before passing them on, and that tidying is where the trick lives.3684742is the SurveyGizmo survey identifier, a number that picks out one survey on the platform.8f95c5a8a547is the trailing segment, the piece of content being served.
The researcher states that the arbitrary content is injected.
Why this step? Because it is the simplest demonstration. If a page you did not create appears under Mozilla's name, the trust in that name is broken.
Step 2: arbitrary content with an attacker-chosen string (POC #2)
Open this address:
http://qsurvey.mozilla.com//s3/3684742/Hacked-by-Ak1t4
Line by line:
- The host and the doubled slash are the same as before.
3684742is again the survey identifier.Hacked-by-Ak1t4is a string the attacker picked. It is not a fixed page name; it is whatever the attacker typed.
Again the researcher states that arbitrary content is injected, this time with a string the attacker picked.
Step 3: PDF generation from a remote article URL (Vulnerable Link #1)
Open this address:
http://qsurvey.mozilla.com/pro/html2pdf/generateArticlePdf.php?article_content=http://qsurvey.mozilla.com//s3/3684742/Hacked-by-Ak1t4
Line by line:
qsurvey.mozilla.com/pro/html2pdf/generateArticlePdf.phpis a script on the server. Its name suggests it turns an article into a PDF.html2pdfis shorthand for "HTML to PDF": HTML is the language web pages are written in, and PDF is the fixed-layout document format you open in a reader.- The
?marks the start of the parameters. article_content=is the parameter name. It tells the script what article content to use.- The value after the
=is the same attacker-controlled address from step 2.
The researcher then says to open the resulting document and click the link labelled [CLICK-ME].
Step 4: PDF generation from a remote URL (Vulnerable Link #2)
Open this address:
http://qsurvey.mozilla.com/pro/html2pdf/generateapple_landscape.php?URL=https://www.surveygizmo.com/s3/3684742/Hacked-by-Ak1t4
Line by line:
generateapple_landscape.phpis a second script in the same folder. The name suggests it produces a landscape-oriented document, perhaps for Apple devices.URL=is this script's parameter name. Notice it is different fromarticle_contentin step 3: two scripts in the same family, two different names for the same idea.- The value points at
www.surveygizmo.comrather than the Mozilla host.
As in step 3, the researcher says to open the document and click the [CLICK-ME] link.
Why this step? Because it shows the problem is not one script with one parameter. The same pattern appears in a second script with a different parameter name, which makes it more likely to be a design habit rather than a one-off mistake.
Attack variations
The report lists further spellings of the same path:
http://qsurvey.mozilla.com//s3/3684742/Hacked-by-Ak1t4
http://qsurvey.mozilla.com//s3/3684742/8f95c5a8a547
http://qsurvey.mozilla.com///s3/3684742/Hacked-by-Ak1t4
http://qsurvey.mozilla.com//s3/3684742/8f95c5a8a547
http://qsurvey.mozilla.com//\s3/3684742/Hacked-by-Ak1t4
http://qsurvey.mozilla.com//s3/3684742/8f95c5a8a547
http://qsurvey.mozilla.com///\s3/3684742/Hacked-by-Ak1t4
What changes between them:
- Some have two leading slashes (
//s3/), some have three (///s3/). - Some insert a backslash before
s3, as in//\s3/and///\s3/. A backslash is the other kind of slash, the one usually used in Windows file paths. Web servers and proxies do not always agree on what it means, which is why it is worth trying. - The trailing segment alternates between the fixed-looking
8f95c5a8a547and the attacker-chosenHacked-by-Ak1t4.
The report does not state which of these variants were confirmed to render content. They are presented as variations of the same attack, not as separately verified results.
Root cause
The report does not analyse the server-side code. What it shows is that a request path containing //s3/, and the listed slash and backslash variants, is resolved to SurveyGizmo's /s3/ content path while the browser still treats the response as belonging to qsurvey.mozilla.com.
A useful comparison: imagine a receptionist who is told "deliver this to room 12". If someone writes "room //12", a careless receptionist might still deliver it to room 12, because they tidy up the address in their head. The report does not explain why the doubled separator resolves to SurveyGizmo's content path.
The PDF scripts are a separate issue. generateArticlePdf.php and generateapple_landscape.php take the content source from the query string, through article_content and URL respectively.
Impact
The researcher states that the issues impact Mozilla survey users directly. An attacker can use them for malicious purposes: targeting the organisation with fake login forms, spreading phishing, and stealing sensitive user information such as site accounts, credentials, cookies and credit card information.
A few of those terms, since they come up a lot:
- Phishing: a fake page or message that pretends to be a trusted service in order to make you type your password or payment details.
- Credentials: your username and password, the pair that proves who you are.
- Cookies: small pieces of data a website stores in your browser so it can remember you between page loads, for example that you are logged in. If someone steals your cookie, they may be able to act as you without knowing your password.
The report does not record a severity, a CVSS score or a bounty amount.
Fix
The report's only recommendation is to contact the vendor as soon as possible for a patch or to launch a fix, naming surveygizmo.com.
Variants to test
If you want to look for the same kind of problem elsewhere, the report's pattern suggests four directions:
- Send a doubled or tripled slash before a known content path on other hosts that proxy a third-party platform, for example
//s3/<id>/<string>. A positive result is a response served under the target hostname whose body reflects the trailing string. - Insert a backslash before the path segment, as in
//\s3/...and///\s3/.... A positive result is the same reflected content, showing that the normalisation also mishandles backslashes. - Look for PDF or document generators that take a URL or body from the query string, such as
article_contentorURL. A positive result is a generated document containing a link to the supplied value. - Try the same parameter names on other endpoints of the same generator family, since the report shows two scripts (
generateArticlePdf.phpandgenerateapple_landscape.php) with different parameter names.
Hunting notes
This kind of bug tends to sit where a first-party hostname fronts a third-party SaaS product, because the proxy layer has to reconcile two path conventions. SaaS stands for software as a service: software run by another company and reached over the internet, like SurveyGizmo here. During recon, a subdomain whose content is clearly served by an external platform is the signal; a doubled slash in a working URL is the confirmation to look for.
The researcher showed the attacker-chosen string in the URL and referenced it from the PDF generator URLs.
Glossary
- Arbitrary content: content chosen by the attacker rather than by the site owner.
- Backslash: the
\character, used in Windows file paths. Servers and proxies do not always treat it the same way as a forward slash. - Cookie: a small piece of data a site stores in your browser to remember you, for example that you are logged in.
- Credentials: a username and password, or similar proof of identity.
- CVSS: a standard scoring system for rating the severity of a security issue.
- Domain: the main part of a web address, such as
mozilla.com. - Front end / proxy: the layer that receives a request first and passes it on to the system that actually produces the content.
- Host: the machine or service named in a URL, such as
qsurvey.mozilla.com. - HTML: the language web pages are written in.
- HTTP / HTTPS: the rules for fetching web pages; HTTPS is the encrypted version.
- Normalisation: tidying up a path or address into a standard form before using it.
- Parameter: a name and value pair after a
?in a URL, used to pass options to a script. - Path: the part of a URL after the hostname that identifies the resource.
- PDF: a fixed-layout document format opened in a reader.
- Phishing: a fake page or message that pretends to be a trusted service to steal information.
- PHP: a programming language used to build server-side web scripts.
- Proof of concept (POC): a concrete example that demonstrates a problem is real.
- Recon: the information-gathering phase before testing, where you map out what a target runs.
- SaaS: software as a service; software run by another company and reached over the internet.
- Subdomain: the part in front of the main domain, such as
qsurveyinqsurvey.mozilla.com. - SurveyGizmo (SG): the third-party survey platform behind
qsurvey.mozilla.com. - User Agent: the line of text a browser sends to describe itself, including browser, version and operating system.
- Validation: checking that input is acceptable before using it.