How I was able to list some internal information from PayPal #BugBounty
A page on manager.paypal.com was vulnerable to Expression Language Injection (JSTL), allowing an attacker to evaluate expressions and extract internal information such as internal IP, port, and class names. The attacker could not achieve remote code execution due to a WAF blocking further exploitation.
Published on medium.com
Since september 2017, I started doing Bug Bounty on a regular basis (every night). Until now (and still today) I use the bountyfactory.io platform for hunter.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Context
PayPal runs a bug bounty programme with a wide scope covering *.paypal.com. The researcher set himself a personal challenge in February 2018 to find a vulnerability on PayPal, and after several days of reconnaissance he found an interesting page on manager.paypal.com. The page presented several input fields but no submit button, and its design looked old compared with the rest of the site. That page was vulnerable to Expression Language Injection in the JSTL flavour, and through it the researcher was able to extract internal information such as an internal IP, an internal port, an internal class and more.
The author is explicit that he is not an expert and that the article is a fair account of his discovery and his way of proceeding, so some elements may be missing.
Setup
Since September 2017 the researcher had been doing bug bounty on a regular basis, every night, using the bountyfactory.io platform as a hunter. For this target he started with the usual reconnaissance: listing subdomains, listing files and directories. The tools that matter later in the story are:
- Wappalyzer, the browser plugin used to fingerprint the technology behind the page.
- Burp Suite, and specifically its Intruder functionality, used to fuzz parameters.
- The public PayPal bug bounty terms page, which the report links to.
No accounts, roles or special preconditions are described. The page was reachable and its fields could be driven through GET parameters.
Finding it
After some days of reconnaissance the researcher came across the page on manager.paypal.com. His reaction, as he puts it, was that there were several fields, no button to submit, and the page looked old compared with the design, so it was worth trying something with all of that.

The screenshot shows the page he found, with its several fields and no submit button.
He then ran Wappalyzer against it. The plugin was, in his words, clearly not talkative: no version, no information, except "Apache".

With no version information to work from, he started studying the source code to see whether certain elements could be interesting. He noted the names of the fields, put all of them as GET parameters, and sent the query.

Exploitation
Step 1: reflected XSS, abandoned
His first idea was a reflected XSS. He dropped the idea: PayPal has a relatively efficient WAF and he did not manage to find a bypass. He adds that a bypass was certainly possible but that he lacked the skills for it.
Step 2: injecting data
Because reflected XSS was unsuccessful, he decided to try different payloads that he had already seen on other bug bounty programmes:
The last payload, ${7*7}, was a success and worked.

His own comment on this result is that being able to do a mathematical operation on a server is fun but is not a vulnerability. So he went looking for information about Java and about how ${param} works.
Step 3: identifying JSTL and its implicit objects
After some research, and with help from Nico, he discovered that this was JSTL and that it has an interesting syntax. The article he cites on the JSTL Expression Language explains that the JSTL implicit objects can access servlet and JSP properties, such as a request's protocol or server port, or the major and minor versions of the servlet API the container supports, through the pageContext implicit object, which gives access to the request, response, session and application (also known as the servlet context).
The useful properties listed for the pageContext implicit object are:
pageContext.requestpageContext.responsepageContext.propertiespageContext.pagepageContext.servletConfigpageContext.servletContext
He does not detail every existing implicit object, but notes that they are used when a developer wants to interact with the page, the servlet and the server.
Step 4: fuzzing the implicit objects with Burp Intruder
He then started to find every parameter that could be useful, through documentation plus fuzzing, and injected them into Burp Suite's Intruder.

It worked: it was possible to extract internal information from PayPal, in a way comparable to an SSRF, with some limited possibility. He apologises for the next screenshot being useless, explaining that it is only there to show that he had results but that he is not allowed to post them.

Step 5: a parameter not in the documentation
Through fuzzing he found a parameter that he did not find in the documentation:
${pageContext.servletContext.docRoot}
This implicit object displays the relative path where the compiled WAR file is hosted on the server.
Step 6: attempting remote code execution
After this discovery he tried to turn the Expression Language Injection into a remote code execution. It was not successful. He had read many write-ups and proofs of concept about JSTL injection and RCE but never succeeded. He supposes it was because PayPal uses a WAF, and during his attempts the WAF seemed to block the injection and he got a 301 redirect.
He tried some basic payloads to test, for example:
${T(java.lang.System).getenv()}
None of them worked for him. The response returned from the server was always stopped where he injected his payload. He offers a second possibility: that he did not have the skills and that RCE was possible but he simply did not find how to do it.
Root cause
User-controlled input reaching a JSTL expression that the server evaluates is the underlying mistake. The page took the field names as GET parameters and evaluated them as Expression Language, so ${7*7} was computed server-side and the pageContext implicit objects exposed servlet and container properties. The report does not show the server-side code, so the exact place where the input is passed into the expression is not stated; it is likely that a parameter was interpolated into an EL expression without being treated as literal data.
The existing defences did not stop the arithmetic evaluation and the information disclosure. The WAF did appear to interfere with the RCE attempts, which came back as 301 redirects, but it did not prevent the expression evaluation itself.
Impact
An attacker could extract internal information from PayPal through the injected expressions, in a way comparable to an SSRF with some limited possibility. The concrete items the researcher mentions are an internal IP, an internal port, an internal class and more, plus the relative path where the compiled WAR file is hosted on the server via ${pageContext.servletContext.docRoot}. He was not allowed to publish the actual Intruder results.
Remote code execution was attempted and not achieved, so the impact described here stops at information disclosure. The researcher hedges on why RCE failed: either the WAF blocked it or he lacked the skill to get there.
Fix
The report does not describe the code change. The timeline records that the vulnerability was fixed on 03-04-2018, after PayPal's second response on 29-03-2018 confirming the report was valid. What should be done is to stop passing user-controlled input into EL expressions, so that parameter values are treated as data and never evaluated.
Variants to test
- Send the arithmetic probes
{7*7},{{7*7}}and${7*7}in every parameter of an old-looking page. A positive result is the response containing the computed product where the payload was reflected. - Enumerate the
pageContextimplicit objects listed above (pageContext.request,pageContext.response,pageContext.properties,pageContext.page,pageContext.servletConfig,pageContext.servletContext) as parameter values. A positive result is server-side properties such as protocol, port or servlet API version appearing in the response. - Try
${pageContext.servletContext.docRoot}. A positive result is the relative path where the compiled WAR file is hosted on the server. - Try the RCE probe
${T(java.lang.System).getenv()}. A positive result is environment variables in the response; a301redirect suggests a WAF is interfering, as it seemed to here. - Fingerprint the stack with Wappalyzer before probing. Fingerprint the stack with Wappalyzer before probing; in this case it reported only "Apache" with no version.
Timeline
| Date | Event |
|---|---|
| 06-03-2018 | Vulnerability found |
| 07-03-2018 | Report sent to PayPal |
| 08-03-2018 | First response from PayPal: no security risk, not eligible for reward |
| 29-03-2018 | Second response from PayPal: report is valid |
| 03-04-2018 | Vulnerability fixed |
| 11-04-2018 | Reward paid, plus Hall of Fame in June 2018 |
Resources that helped
What happened, in plain words
PayPal runs a bug bounty programme. A bug bounty programme is a public offer from a company: if you find a security problem in their systems and report it responsibly, they may thank you, fix it, and sometimes pay you a reward. The researcher set himself a personal challenge in February 2018 to find a vulnerability on PayPal. A vulnerability is a weakness in a website or program that lets someone make it behave in a way its owners did not intend.
After several days of looking around, he found an interesting page on manager.paypal.com. The page had several input fields but no button to submit them, and its design looked old compared with the rest of the site. That page was vulnerable to something called Expression Language Injection, in a flavour called JSTL. Through it, the researcher was able to pull out internal information such as an internal IP address, an internal port, an internal class and more.
The author is clear that he is not an expert and that the article is an honest account of his discovery and his way of working, so some elements may be missing.
Setting up
Since September 2017 the researcher had been doing bug bounty regularly, every night, using the bountyfactory.io platform as a hunter. A platform like this is a website where security researchers can find programmes, read their rules and submit reports.
For this target he started with the usual reconnaissance. Reconnaissance (often shortened to recon) means gathering information about a target before attacking it: which subdomains exist, which files and directories are reachable, and so on. A subdomain is a name like manager.paypal.com that sits under the main domain paypal.com.
The tools that matter later in the story are:
- Wappalyzer, a browser plugin that tries to guess which technologies a website is built with (server software, programming language, frameworks).
- Burp Suite, a tool used by security testers to intercept and modify the traffic between their browser and a website. Its Intruder functionality sends many variations of a request automatically, which is called fuzzing.
- The public PayPal bug bounty terms page, which the report links to.
No accounts, roles or special preconditions are described. The page was reachable and its fields could be driven through GET parameters. A GET parameter is the part of a web address after the question mark, like ?name=value, which a website reads to decide what to show.
Finding it
After some days of reconnaissance the researcher came across the page on manager.paypal.com. His reaction, as he puts it, was that there were several fields, no button to submit, and the page looked old compared with the design, so it was worth trying something with all of that.

The screenshot shows the page he found, with its several fields and no submit button.
He then ran Wappalyzer against it. The plugin was, in his words, clearly not talkative: no version, no information, except "Apache". Apache is a very common web server program, the software that answers requests for a website.

With no version information to work from, he started studying the source code to see whether certain elements could be interesting. The source code is the HTML that the browser receives and renders; you can view it in any browser with "View source". He noted the names of the fields, put all of them as GET parameters, and sent the query.

Exploitation
Step 1: reflected XSS, abandoned
His first idea was a reflected XSS. XSS stands for Cross-Site Scripting: a class of bug where a website takes something a visitor sends and puts it back into the page without proper handling, so that the visitor's browser runs it as code. "Reflected" means the input is echoed straight back in the response rather than stored.
He dropped the idea: PayPal has a relatively efficient WAF and he did not manage to find a bypass. A WAF, or Web Application Firewall, is a filter that sits in front of a website and blocks requests that look malicious. A bypass is a way of getting past that filter. He adds that a bypass was certainly possible but that he lacked the skills for it.
Step 2: injecting data
Because reflected XSS was unsuccessful, he decided to try different payloads that he had already seen on other bug bounty programmes. A payload is the piece of input you send to test or exploit a weakness.
Each line is a small arithmetic expression wrapped in different brackets. The idea is simple: if the website simply displays the text back, you see the text. If the website treats the content between the brackets as something to compute, you see the result of the multiplication instead. The last payload, ${7*7}, was a success and worked.

His own comment on this result is that being able to do a mathematical operation on a server is fun but is not a vulnerability. So he went looking for information about Java and about how ${param} works. Java is a programming language widely used for web applications; ${...} is a syntax that some Java web technologies use to insert values into a page.
Step 3: identifying JSTL and its implicit objects
After some research, and with help from Nico, he discovered that this was JSTL and that it has an interesting syntax. JSTL stands for JavaServer Pages Standard Tag Library, a set of ready-made tags used inside Java web pages. It includes an expression language, a small language for writing expressions inside a page.
The article he cites on the JSTL Expression Language explains that the JSTL implicit objects can access servlet and JSP properties, such as a request's protocol or server port, or the major and minor versions of the servlet API the container supports, through the pageContext implicit object, which gives access to the request, response, session and application (also known as the servlet context).
A few of those words deserve a plain explanation:
- A servlet is a Java program that runs on a server and handles web requests.
- JSP, JavaServer Pages, is a way of writing web pages that mix HTML with Java code.
- An implicit object is a variable that the expression language makes available automatically, without the developer declaring it.
pageContextis the implicit object that represents everything about the current page and its surroundings.- The servlet context is the shared environment of the whole web application.
The useful properties listed for the pageContext implicit object are:
pageContext.requestpageContext.responsepageContext.propertiespageContext.pagepageContext.servletConfigpageContext.servletContext
He does not detail every existing implicit object, but notes that they are used when a developer wants to interact with the page, the servlet and the server. In other words, these are handles that a page can use to ask the server about itself.
Step 4: fuzzing the implicit objects with Burp Intruder
He then started to find every parameter that could be useful, through documentation plus fuzzing, and injected them into Burp Suite's Intruder. Fuzzing means sending lots of variations automatically and watching which ones produce something different. Intruder is the part of Burp Suite that does this: you give it a request with a placeholder, a list of values, and it sends one request per value.

It worked: it was possible to extract internal information from PayPal, in a way comparable to an SSRF, with some limited possibility. SSRF stands for Server-Side Request Forgery: a bug where the server can be made to fetch or reveal things from its own internal network, which an outside visitor could not reach directly. He apologises for the next screenshot being useless, explaining that it is only there to show that he had results but that he is not allowed to post them.

Step 5: a parameter not in the documentation
Through fuzzing he found a parameter that he did not find in the documentation:
${pageContext.servletContext.docRoot}
This is one expression. ${ opens the expression, pageContext is the implicit object for the current page, .servletContext reaches the shared application environment, .docRoot asks for a property of it, and } closes the expression. This implicit object displays the relative path where the compiled WAR file is hosted on the server. A WAR file is a packaged Java web application; its path on disk is internal information that a normal visitor should never see.
Step 6: attempting remote code execution
After this discovery he tried to turn the Expression Language Injection into a remote code execution. Remote code execution, usually shortened to RCE, is the most serious kind of bug: it means an attacker can make the server run their own commands. It was not successful. He had read many write-ups and proofs of concept about JSTL injection and RCE but never succeeded. A proof of concept, or PoC, is a small demonstration that a bug is real.
He supposes it was because PayPal uses a WAF, and during his attempts the WAF seemed to block the injection and he got a 301 redirect. A 301 is an HTTP status code meaning "moved permanently": the server answers by telling the browser to go somewhere else instead of returning the page.
He tried some basic payloads to test, for example:
${T(java.lang.System).getenv()}
This expression asks the server to reach the Java System class and call getenv(), which returns the environment variables of the machine. Environment variables are settings the operating system passes to programs, and they often contain sensitive configuration. None of them worked for him. The response returned from the server was always stopped where he injected his payload. He offers a second possibility: that he did not have the skills and that RCE was possible but he simply did not find how to do it.
Root cause
User-controlled input reaching a JSTL expression that the server evaluates is the underlying mistake. The page took the field names as GET parameters and evaluated them as Expression Language, so ${7*7} was computed server-side and the pageContext implicit objects exposed servlet and container properties. The report does not show the server-side code, so the exact place where the input is passed into the expression is not stated; it is likely that a parameter was interpolated into an EL expression without being treated as literal data.
The existing defences did not stop the arithmetic evaluation and the information disclosure. The WAF did appear to interfere with the RCE attempts, which came back as 301 redirects, but it did not prevent the expression evaluation itself.
Impact
An attacker could extract internal information from PayPal through the injected expressions, in a way comparable to an SSRF with some limited possibility. The concrete items the researcher mentions are an internal IP, an internal port, an internal class and more, plus the relative path where the compiled WAR file is hosted on the server via ${pageContext.servletContext.docRoot}. He was not allowed to publish the actual Intruder results.
Remote code execution was attempted and not achieved, so the impact described here stops at information disclosure. The researcher hedges on why RCE failed: either the WAF blocked it or he lacked the skill to get there.
Fix
The report does not describe the code change. The timeline records that the vulnerability was fixed on 03-04-2018, after PayPal's second response on 29-03-2018 confirming the report was valid. What should be done is to stop passing user-controlled input into EL expressions, so that parameter values are treated as data and never evaluated.
Variants to test
- Send the arithmetic probes
{7*7},{{7*7}}and${7*7}in every parameter of an old-looking page. A positive result is the response containing the computed product where the payload was reflected. - Enumerate the
pageContextimplicit objects listed above (pageContext.request,pageContext.response,pageContext.properties,pageContext.page,pageContext.servletConfig,pageContext.servletContext) as parameter values. A positive result is server-side properties such as protocol, port or servlet API version appearing in the response. - Try
${pageContext.servletContext.docRoot}. A positive result is the relative path where the compiled WAR file is hosted on the server. - Try the RCE probe
${T(java.lang.System).getenv()}. A positive result is environment variables in the response; a301redirect suggests a WAF is interfering, as it seemed to here. - Fingerprint the stack with Wappalyzer before probing. Fingerprint the stack with Wappalyzer before probing; in this case it reported only "Apache" with no version.
Timeline
| Date | Event |
|---|---|
| 06-03-2018 | Vulnerability found |
| 07-03-2018 | Report sent to PayPal |
| 08-03-2018 | First response from PayPal: no security risk, not eligible for reward |
| 29-03-2018 | Second response from PayPal: report is valid |
| 03-04-2018 | Vulnerability fixed |
| 11-04-2018 | Reward paid, plus Hall of Fame in June 2018 |
Resources that helped
- https://portswigger.net/kb/issues/00100f20_expression-language-injection
- https://magicbluech.github.io/2017/12/02/VelocityServlet-Expression-language-Injection
- http://blog.mindedsecurity.com/2015/11/reliable-os-shell-with-el-expression.html
Glossary
- Bug bounty programme: a public offer from a company to reward people who find and report security problems in its systems.
- Vulnerability: a weakness in a website or program that lets someone make it behave in a way its owners did not intend.
- Reconnaissance (recon): gathering information about a target before attacking it, such as subdomains, files and directories.
- Subdomain: a name like
manager.paypal.comthat sits under a main domain such aspaypal.com. - Wappalyzer: a browser plugin that guesses which technologies a website is built with.
- Burp Suite: a tool used by security testers to intercept and modify traffic between a browser and a website.
- Intruder: the part of Burp Suite that sends many variations of a request automatically.
- Fuzzing: sending lots of variations of input automatically and watching which ones produce something different.
- GET parameter: the part of a web address after the question mark, like
?name=value, which a website reads to decide what to show. - Apache: a very common web server program, the software that answers requests for a website.
- Source code: the HTML that the browser receives and renders, viewable with "View source".
- XSS (Cross-Site Scripting): a bug where a website puts visitor-supplied content back into the page without proper handling, so the browser runs it as code.
- Reflected XSS: an XSS where the input is echoed straight back in the response rather than stored.
- WAF (Web Application Firewall): a filter in front of a website that blocks requests that look malicious.
- Bypass: a way of getting past a filter such as a WAF.
- Payload: the piece of input you send to test or exploit a weakness.
- Java: a programming language widely used for web applications.
- JSTL (JavaServer Pages Standard Tag Library): a set of ready-made tags used inside Java web pages, including an expression language.
- Expression Language (EL): a small language for writing expressions inside a Java web page, using
${...}syntax. - Servlet: a Java program that runs on a server and handles web requests.
- JSP (JavaServer Pages): a way of writing web pages that mix HTML with Java code.
- Implicit object: a variable that the expression language makes available automatically, without the developer declaring it.
pageContext: the implicit object that represents everything about the current page and its surroundings.- Servlet context: the shared environment of the whole web application.
- SSRF (Server-Side Request Forgery): a bug where the server can be made to fetch or reveal things from its own internal network, which an outside visitor could not reach directly.
- WAR file: a packaged Java web application.
- RCE (Remote Code Execution): the most serious kind of bug, where an attacker can make the server run their own commands.
- Proof of concept (PoC): a small demonstration that a bug is real.
301redirect: an HTTP status code meaning "moved permanently", where the server tells the browser to go somewhere else instead of returning the page.- Environment variables: settings the operating system passes to programs, often containing sensitive configuration.
- Information disclosure: a bug where internal information that should stay private is revealed to an outsider.