Remote code execution [CVE-2023-36845]
A PHP environment variable in Juniper's J-Web interface could be modified by an unauthenticated attacker through a crafted request, allowing control of important environment variables. This could lead to partial loss of integrity and, as the report claims, remote code execution on Juniper firewalls.
- Triaged in 17 hours
- Fixed in 4 months
- Disclosed after 12 months
CVE-2023-36845
A PHP External Variable Modification vulnerability in J-Web of Juniper Networks Junos OS on EX Series and SRX Series allows an unauthenticated, network-based attacker to control certain, important environments variables. Utilizing a crafted request an attacker is able to modify a certain PHP environment variable leading to partial loss of integrity,
POC :
with curl 41.205.30.222 = host-41.205.30.222.mtn.cm
curl -sk "https://41.205.30.222/?PHPRC=/dev/fd/0" -X POST -d 'auto_prepend_file="/etc/passwd"'

Impact
CVE-2023-36845 that allows an unauthenticated and remote attacker to execute arbitrary code on Juniper firewalls without creating a file on the system.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the J-Web PHP configuration accepts user-supplied input for the PHPRC environment variable, letting an attacker point PHP at an arbitrary file for its configuration.
Impact
An unauthenticated remote attacker could execute arbitrary code on Juniper firewalls without creating a file on the system, though the text only explicitly claims partial loss of integrity.
What the attacker needed
Network access to J-Web; no authentication required
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
A flaw in Juniper's web management interface lets an unauthenticated attacker send a crafted request that changes a PHP environment variable, which can lead to code execution on the firewall.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.