Outdated PHP Version leads to RCE
The server leaked its PHP version, which was vulnerable to a backdoor that allowed remote code execution. An attacker could send a crafted User-Agent header to execute system commands.
Published on medium.com
Hi Everyone, back again with my one more Bug Bounty write-up. This time i got a Remote code execution vulnerability in a Private Bug Bounty Program.
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 write-up describes a remote code execution (RCE) vulnerability found in a private bug bounty program. The report does not name the target, the product or the affected feature; it only says the work was done during recon on a private program. During recon, the PHP version disclosed in the server header led the researcher to a publicly documented backdoor related to the Zend PHP framework.
The author first defines the class of bug. RCE is a vulnerability in which an attacker can execute malicious code or commands on a target machine. Two types are described:
- Generic RCE: the output of the command or code executed is returned in the response. An
idorwhoamicommand is enough to validate this type. - Blind RCE: the output is not displayed in the response. The suggested way to validate it is to execute the
sleepcommand and check whether the application actually sleeps for the specified time before returning the response.
The stated impact of RCE is broad: adding, reading, modifying and deleting files; changing access privileges; turning configurations and services on and off; and communicating with other servers.

Setup
The report gives no details about accounts, roles, tooling or the exact PHP version. The researcher's own tooling is not named.
Finding it
During recon, the researcher noticed that the server header leaked the PHP version.

That version string was the only lead. The researcher searched it on Google to see whether anything interesting was known about it.

Among the results was a backdoor that allows remote code execution, related to the Zend PHP framework. The report cites the public exploit entry as its reference:
https://www.exploit-db.com/exploits/49933
The report describes the issue as a remote command execution vulnerability caused by a backdoor left in that version of the software. The behaviour of the backdoor, as the author explains it, is that if zerodium is added as a user agent, any text after it is interpreted and executed as a system command. The author notes that the header needs to be renamed, or a new header added, for this to work, and uses User-Agentt for that purpose.
Exploitation
Step 1: send the backdoor header
The researcher sent an additional user agent header carrying the backdoor trigger followed by a command:
User-Agentt: zerodiumsystem("id");
In this header, zerodium is the marker the backdoor looks for, and the text after it, here system("id");, is what gets interpreted and executed as a system command. The id command matches the generic-RCE validation the author described earlier. The doubled t in User-Agentt is deliberate, matching the renamed header the author described.


The author reports that the RCE was obtained. The report does not show the response body or the output of id, and it does not state the bounty amount, only that a bounty was paid.
Root cause
The root cause, as the report frames it, is a backdoor left in that version of the software, related to the Zend PHP framework. The backdoor inspects the user agent for the zerodium marker and passes whatever follows it to the system for execution.
The only contributing factor it identifies is that the server header disclosed the PHP version, which made the vulnerable component easy to spot during recon.
Impact
Successful exploitation gives command execution on the target machine. Using the author's own list of RCE impact, an attacker could add, read, modify or delete files; change access privileges; turn configurations and services on and off; and communicate with other servers.
Fix
The report gives two mitigations rather than describing a specific patch:
- Operating systems and third-party software need to be updated regularly.
- Validate and sanitise user entries and inputs.
The first point covers updating operating systems and third-party software regularly.
Variants to test
- A positive result is an exact framework or runtime version that can be matched against public advisories and exploit entries.
- Known backdoors in the disclosed version. Search the leaked version on the web, as the researcher did here, and check public exploit entries. A positive result is a documented backdoor or command execution primitive for that exact version.
- A positive result is command output returned in the response, or a measurable delay when using a
sleep-style command for blind cases.
What happened, in plain words
A security researcher was taking part in a private bug bounty program. A bug bounty program is an arrangement where an organisation invites people to look for security weaknesses in its systems and pays them for reporting what they find. "Private" means only invited researchers can take part, and the organisation's name is not made public here.
While looking around the program's systems (a phase called recon, short for reconnaissance), the researcher noticed that one of the servers was telling anyone who asked which version of a programming tool called PHP it was running. That small piece of information turned out to be the key to the whole finding: it led the researcher to a known backdoor.
The researcher searched the internet for that version and found a backdoor related to the Zend PHP framework. A backdoor is a hidden way into software, deliberately left there by whoever built or tampered with it, that lets someone run commands without going through the normal login. In this case the backdoor watched for a particular word in a request header, and any text after it would be interpreted and executed as a system command. That is remote code execution, or RCE: the ability to make a machine run your commands from somewhere else.
The researcher sent a request with the magic word and a simple command, and reports that the RCE was obtained. The report says a bounty was paid, but it does not say how much.

What is RCE?
The author starts by defining the class of bug. RCE is a vulnerability in which an attacker can execute malicious code or commands on a target machine. A vulnerability is simply a weakness in software that someone can abuse to make it do something its owners did not intend. "Executing a command" means asking the computer's operating system to do something, the same way you would type a command into a terminal window.
A useful everyday comparison: most of the time you interact with a website through the front door, clicking buttons and filling in forms, and the website decides what you are allowed to do. RCE is like finding a hatch at the back of the building that lets you walk straight into the control room and use the machinery yourself.
Types of RCE
The author describes two types:
- Generic RCE: the output of the command or code executed is returned in the response. An
idorwhoamicommand is enough to validate this type of Remote Code Execution. - Blind RCE: the output of the command or code executed will not be displayed in the response. A best way to validate a Blind RCE is to execute the
sleepcommand and check if the application actually sleeps for a specified time before returning the response.
In plain words: with generic RCE you can see the answer come back, like shouting into a room and hearing a reply. With blind RCE you cannot see the answer, so you have to find another signal. The sleep trick works because you ask the server to wait a few seconds; if the page really does take that long to come back, you know your command ran even though you never saw its output.
The two commands named here are ordinary system commands. id prints which user account the command is running as, and whoami prints the account name. They are popular for confirming RCE because they are harmless and their output is easy to recognise.
Impact of Remote Code Execution
The author lists what an attacker could do once they have command execution:
- Add, read, modify, delete files
- Change access privileges
- Turn on and off configurations and services
- Communicate to other servers
Access privileges are the permissions that decide what an account is allowed to do, for example whether it can read a particular folder or change settings. "Communicate to other servers" means the compromised machine can be used to reach other machines, which is how one broken server can become a stepping stone into a wider network.
My Scenario of RCE:-
During the recon on the program, I saw that the server header leak the PHP version.

A header is a small piece of information that travels alongside every request and response on the web, a bit like the label on a parcel. The browser sends headers describing what it wants, and the server sends headers back describing what it is. The Server header is the one where a server often announces what software it runs. Here it revealed the PHP version, which is the equivalent of a shop putting a sign in the window saying exactly which model of lock it uses.
So i search it over google to see if I can see anything interesting.

This is a normal next step: a version number on its own is not a vulnerability, but it tells you what to look up. Searching a version against public information is how researchers connect a small clue to a known problem.
Looking at the results, I saw that there is a backdoor that allows us to perform remote code execution. This backdoor was related to the Zend PHP framework.
Reference: https://www.exploit-db.com/exploits/49933
Exploit-DB is a public archive of documented exploits, meaning write-ups and code that show how a particular weakness can be triggered. The link above is the entry the researcher used as a reference.
This appears to be a remote command execution vulnerability due to a backdoor that was left in this version of the software.
Basically, if “zerodium” was added as a user agent (this header needs to be renamed or add a new header i.e “User-Agentt” for this to work), any text after it would be interpreted and executed as a system command.
The user agent is a header your browser sends to tell the server what browser and operating system you are using. The backdoor was built to look inside that header for the word zerodium, and to treat whatever followed it as a command. The author notes that the header has to be renamed, or a new one added, for the trick to work, and uses User-Agentt with a doubled t for that purpose. The author notes the header has to be renamed, or a new one added, for the trick to work, and uses User-Agentt with a doubled t for that purpose.
So i tried to enter one more User-Agent,
User-Agentt: zerodiumsystem(“id”);


Line by line, this is what the header contains:
User-Agenttis the header name, deliberately spelled with twots so it matches what the backdoor expects.zerodiumis the marker word the backdoor searches for.system("id");is the part after the marker.systemis a function that runs a command on the machine, andidis the command being run. The semicolon is just the punctuation that ends the statement.
So the whole line means: "if you are the backdoor, run the id command for me." The researcher used id, the command the author earlier named for validating generic RCE.
BOOM ..!! 🤩🤩…Got the RCE
Bounty=$$$$
The report says the RCE was obtained and that a bounty was paid. It does not show the response body or the output of id, and it does not state the amount.
Mitigation
- Operating Systems and third-party software need to be updated regularly.
- Validate and sanitise user entries and inputs.
The first point covers updating operating systems and third-party software regularly. "Third-party software" means anything running on the server that was not written by the organisation itself, such as PHP or a framework. The second point is a general habit: check what users send in and clean it before using it, so unexpected input cannot be treated as a command.
Variants to test
These are the same ideas generalised, so a beginner can look for similar issues elsewhere:
- A positive result is an exact framework or runtime version that can be matched against public advisories and exploit entries. In plain words: look at what the server tells you about itself, then look up that version.
- Known backdoors in the disclosed version. Search the leaked version on the web, as the researcher did here, and check public exploit entries. A positive result is a documented backdoor or command execution primitive for that exact version.
- A positive result is command output returned in the response, or a measurable delay when using a
sleep-style command for blind cases.
Glossary
- Bug bounty program: an arrangement where an organisation pays people for finding and reporting security weaknesses in its systems.
- Private program: a bug bounty program open only to invited researchers, with the organisation's identity not made public.
- Recon (reconnaissance): the information-gathering phase before testing, such as looking at what a server says about itself.
- PHP: a programming language commonly used to build websites.
- Zend PHP framework: a set of PHP components the report associates with the backdoor it describes.
- Backdoor: a hidden way into software, left deliberately, that lets someone run commands or get in without normal login.
- RCE (remote code execution): a weakness that lets an attacker run their own commands or code on a target machine from somewhere else.
- Generic RCE: RCE where the output of the command comes back in the response, so you can see it directly.
- Blind RCE: RCE where the output is not shown, so you confirm it by another signal such as a delay.
- Command: an instruction to the operating system, such as
idorwhoami. id/whoami: harmless system commands that print which user account is running them, used to confirm command execution.sleep: a command that makes the machine wait for a set time, used to confirm blind RCE through timing.- Access privileges: the permissions that decide what an account is allowed to read, change or run.
- Header: a small piece of information sent alongside a web request or response, like a label on a parcel.
Serverheader: a response header where a server may announce what software and version it runs.- User agent: a header a browser sends to say what browser and operating system it is.
User-Agentt: the deliberately misspelled header name used here, with a doubledt, to reach the backdoor.zerodium: the marker word the backdoor looks for in that header.system(): a function that runs a command on the machine.- Exploit: a documented way, often with code, to trigger a particular weakness.
- Exploit-DB: a public archive of documented exploits.
- Vulnerability: a weakness in software that can be abused to make it behave in unintended ways.
- Mitigation: a change that reduces or removes a risk.
- Sanitise / validate input: check and clean what users send in before using it, so unexpected input cannot be treated as a command.
- Bounty: the payment made for a valid report.