Skip to content
Path traversal Disclosed report Intermediate

..; bypass leading to tomcat scripts [Unauthenticated]

Tomcat example servlets were accessible via a path traversal bypass using '..;' in the URL, allowing session manipulation, cookie handling, source code disclosure, and internal IP disclosure. An attacker could potentially become an administrator by manipulating the global session.

rodtvs Follow

Originally disclosed on HackerOne

  • Disclosed after 3 days

Summary by the program

Security researcher identified that Tomcat example/test scripts that are default were still accessible in a test environment/system. Access was restricted and hardening applied as the standard to any production/data handling system would define.

The report

Hello all

Using the technique ..; i was able to bypass the protection mechanism to access Tomcat Example Scripts hosted at https://███/.

Steps to reproduce

1 - Open all URL's bellow inside your browser

[ https://█████████/..;/examples/servlets/servlet/SessionExample] | Will lead to Session Manipulation and potential Account Takeover. Because the session is global this servlet poses a big security risk as an attacker can potentially become an administrator by manipulating its session.

[https://████████/..;/examples/servlets/servlet/CookieExample] | Insecure Cookie Handling

[https://████████/..;/examples/servlets/] | Source Code Disclosure and an "Execute" option

[https://███████/..;/examples/servlets/servlet/RequestHeaderExample] | Internal IP disclosure

PoC

i upload some images.

Fixing

Isolate backend application, Remove the management console and other servlet contexts and Check behaviors between proxy and backend servers. More info here, [https://i.blackhat.com/us-18/Wed-August-8/us-18-Orange-Tsai-Breaking-Parser-Logic-Take-Your-Path-Normalization-Off-And-Pop-0days-Out-2.pdf] --> Orange Tsai -- Blackhat talk -- thanks to him

Impact

Apache Tomcat default installation contains the "/examples" directory which has many example servlets and JSPs. Some of these examples are a security risk and should not be deployed on a production server. The Sessions Example servlet (installed at /examples/servlets/servlet/SessionExample) allows session manipulation. Because the session is global this servlet poses a big security risk as an attacker can potentially become an administrator by manipulating its session.

The original report as published on HackerOne, by rodtvs. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 3 min read.

Context

Apache Tomcat ships with an /examples directory containing sample servlets and JSPs. Some of those examples are dangerous on any system that handles real data: the session example lets a visitor read and write session attributes, the cookie example demonstrates insecure cookie handling, and the servlets index exposes source and an "Execute" option. A default Tomcat installation therefore should not have these contexts reachable in production or in any environment that handles data.

In this report the researcher found that the Tomcat example scripts were still accessible on a test environment, and that a path traversal trick was enough to get past the protection mechanism that was supposed to keep them out. The program's own summary confirms the finding: default Tomcat example/test scripts were still accessible in a test environment/system, access was restricted, and hardening was applied as the standard for any production or data handling system.

Setup

The report does not describe any account, role or tooling. The only precondition it establishes is a Tomcat installation that still contains the default /examples context, fronted by something that was meant to block access to it. The researcher worked entirely from a browser, opening URLs directly.

Finding it

The researcher noticed that the example scripts were reachable despite the protection mechanism in front of them. The bypass uses the ..; sequence in the path; the report links Orange Tsai's Black Hat 2018 talk on path normalisation.

Exploitation

The whole exploitation is a set of URLs opened in a browser. The report gives them as a numbered step.

Step 1: open the example URLs

1 - Open all URL's bellow inside your browser

HTTP
https://[redacted]/..;/examples/servlets/servlet/SessionExample

This leads, in the researcher's words, to session manipulation and potential account takeover. Because the session is global, the servlet poses a big security risk: an attacker can potentially become an administrator by manipulating its session.

HTTP
https://[redacted]/..;/examples/servlets/servlet/CookieExample

This one is described as insecure cookie handling.

HTTP
https://[redacted]/..;/examples/servlets/

This exposes source code and an "Execute" option.

HTTP
https://[redacted]/..;/examples/servlets/servlet/RequestHeaderExample

This one discloses internal IP addresses.

The report does not include the responses returned by any of these requests; it only states the consequence attributed to each servlet.

Step 2: proof of concept

The report says only that images were uploaded as the PoC. No images are reproduced here.

Root cause

The examples context was still present and a protection mechanism was in place that the ..; technique bypassed. The report links Orange Tsai's Black Hat 2018 talk on path normalisation. The report does not name the proxy product or the Tomcat version, so the exact normalisation behaviour on each side is not stated.

Impact

The report frames the impact through the individual servlets:

  • SessionExample allows session manipulation. Because the session is global, an attacker can potentially become an administrator by manipulating its session. The report hedges this as potential account takeover.
  • CookieExample demonstrates insecure cookie handling.
  • The servlets index exposes source code and offers an "Execute" option.
  • RequestHeaderExample discloses internal IP addresses.

The program's summary places the finding in a test environment/system and states that access was restricted and hardening applied. The report does not establish that the same exposure existed on a production system.

Fix

The researcher's fixing advice is threefold: isolate the backend application, remove the management console and other servlet contexts, and check behaviours between proxy and backend servers. The program states that access was restricted and hardening applied to the standard expected of any production or data handling system.

Variants to test

  • A positive result is the same content served through a path the front end did not intend to allow.

Hunting notes

This kind of bug hides wherever a reverse proxy or WAF is the only thing protecting a backend context that should not be reachable at all. The researcher mapped each reachable servlet to a consequence: session manipulation, cookie handling, source disclosure and internal IP disclosure.

Difficulty: beginner. The technique is a single well-known path traversal pattern applied through a browser, with no tooling or custom code required; understanding why it works needs some proxy and Tomcat knowledge.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 6 min read.

What happened, in plain words

Apache Tomcat is a piece of software that runs Java web applications on a server. When you install it, it comes with a folder called /examples that contains sample programs (called servlets and JSPs) put there to teach people how Tomcat works. These samples are meant for learning, not for real use. Some of them are genuinely dangerous if anyone on the internet can reach them, because they let a visitor read and change things they should not touch.

In this report, a security researcher found that those example programs were still reachable on a test system, even though something in front of Tomcat was supposed to block them. The trick used to get past that block is a small piece of text, ..;, placed in the web address.

The program's own summary confirms the finding: default Tomcat example and test scripts were still accessible in a test environment, access was then restricted, and hardening was applied to the standard expected of any production or data handling system.

The setup

The report does not describe any account, role or tooling. The only precondition it establishes is a Tomcat installation that still contains the default /examples folder, with something in front of it that was meant to stop people reaching that folder. The researcher worked entirely from a browser, opening web addresses directly. No special software was needed.

Finding it

The researcher noticed that the example pages could be reached even though a protection mechanism was in place. The bypass uses the sequence ..; inside the path of the address. This is the same kind of problem documented by Orange Tsai in a Black Hat 2018 talk that the report links to.

Exploitation

The whole exploitation is a set of web addresses opened in a browser. The report gives them as a numbered step.

Step 1: open the example URLs

1 - Open all URL's bellow inside your browser

HTTP
https://[redacted]/..;/examples/servlets/servlet/SessionExample

This leads, in the researcher's words, to session manipulation and potential account takeover. A session is how a website remembers who you are between page loads; it is usually tied to a cookie, a small piece of text your browser stores and sends back with every request. If a page lets a visitor change session values freely, an attacker may be able to change their own session into one that looks like an administrator's. Because the session here is global, the servlet poses a big security risk: an attacker can potentially become an administrator by manipulating its session.

HTTP
https://[redacted]/..;/examples/servlets/servlet/CookieExample

This one is described as insecure cookie handling. A cookie is a small label your browser keeps for a site; if a page lets you set cookies carelessly, an attacker can learn how the site stores information or trick a browser into sending the wrong thing.

HTTP
https://[redacted]/..;/examples/servlets/

This exposes source code and an "Execute" option. Source code is the actual programming instructions behind a page; seeing it can reveal how the site works and where its weak points are. An "Execute" option means the page offers a way to run something, which is far more dangerous than just reading.

HTTP
https://[redacted]/..;/examples/servlets/servlet/RequestHeaderExample

This one discloses internal IP addresses. An IP address is the number that identifies a machine on a network; internal ones are normally hidden from the outside world, and learning them helps an attacker map the network behind the site.

The report does not include the responses returned by any of these requests; it only states the consequence attributed to each servlet.

Step 2: proof of concept

The report says only that images were uploaded as the proof of concept. No images are reproduced here.

Root cause

The examples folder was still present and a protection mechanism was in place that the ..; technique bypassed. The report links Orange Tsai's Black Hat 2018 talk on path normalisation. The report does not name the proxy product or the Tomcat version, so the exact behaviour on each side is not stated.

Impact

The report frames the impact through the individual example pages:

  • SessionExample allows session manipulation. Because the session is global, an attacker can potentially become an administrator by manipulating its session. The report hedges this as potential account takeover.
  • CookieExample demonstrates insecure cookie handling.
  • The servlets index exposes source code and offers an "Execute" option.
  • RequestHeaderExample discloses internal IP addresses.

The program's summary places the finding in a test environment and states that access was restricted and hardening applied. The report does not establish that the same exposure existed on a production system.

Fix

The researcher's fixing advice is threefold: isolate the backend application, remove the management console and other servlet contexts, and check behaviours between proxy and backend servers. The program states that access was restricted and hardening applied to the standard expected of any production or data handling system.

Variants to test

  • A positive result is the same content served through a path the front end did not intend to allow.

Hunting notes

This kind of bug hides wherever a reverse proxy or WAF (a web application firewall, a filter that inspects requests before they reach the application) is the only thing protecting a backend folder that should not be reachable at all. The researcher mapped each reachable servlet to a consequence: session manipulation, cookie handling, source disclosure and internal IP disclosure.

Difficulty: beginner. The technique is a single well-known path traversal pattern applied through a browser, with no tooling or custom code required; understanding why it works needs some proxy and Tomcat knowledge.

Glossary

  • Apache Tomcat: software that runs Java web applications on a server.
  • Servlet: a small Java program that runs on a server and produces a web page or response.
  • JSP: JavaServer Pages, a way of writing web pages that mix HTML with Java code.
  • Context: a named web application inside Tomcat, such as /examples or /manager.
  • /examples directory: the folder of sample programs that ships with Tomcat for learning purposes.
  • Proxy: a server that sits between the visitor and the real application and decides what traffic gets through.
  • Reverse proxy: a proxy placed in front of a backend server, handling requests on its behalf.
  • WAF: web application firewall, a filter that inspects requests and blocks ones it considers malicious.
  • Path traversal: using .. in a path to move up out of the intended folder.
  • Path parameter: the ; part of a path segment, which Tomcat strips before resolving the path.
  • Parser discrepancy: when two systems read the same input in different ways, so a check on one side does not match what the other side does.
  • Normalisation: the process of turning a messy path into a standard form before acting on it.
  • Session: how a site remembers who you are between page loads.
  • Cookie: a small piece of text a browser stores for a site and sends back with requests.
  • Session manipulation: changing session values to take on another identity or role.
  • Account takeover: gaining control of another person's account.
  • Source code disclosure: exposing the programming instructions behind a page.
  • Internal IP address: the network number of a machine that is normally hidden from the outside.
  • Header: extra information exchanged between browser and server with each request.
  • 404: the response code meaning the requested page does not exist.
  • Block page: a page shown by a filter instead of the real content, indicating the request was stopped.
  • Recon: the early stage of looking around a target to see what is exposed.
  • PoC: proof of concept, evidence that the problem is real.
  • Hardening: tightening a system's configuration to remove unnecessary exposure.
  • Black Hat: a well-known security conference where research is presented.

More by rodtvs

View all

1 more disclosed report, best first.

More from Informatica

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Path traversal and file inclusion

The lesson behind this report.

Input that builds a file path escapes the intended folder, reading or writing files the application should never touch.