Skip to main content
Mallory
CriticalExploited in the wildCISA KEVPublic exploitVulnerability

CVE-2023-36845: Unauthenticated Remote Code Execution in Juniper Junos OS J-Web via PHPRC Modification

Published Aug 17, 2023 · Updated 17 days ago
Trending this weekNot trendingOutside this week’s top 100
Mention activity · 30 days2 mentions · peak 2 in a dayToday
CVSS9.8Critical · v3.1
EPSS91.4%100th percentile
CISA KEVYesAdded Nov 13, 2023
In the wildActivePer CISA KEV
Vendor
Juniper Networks
IdentifiersCVE-2023-36845CWE-473 · PHP External Variable Modification

CVE-2023-36845 is a PHP external variable modification vulnerability in the J-Web management interface of Juniper Networks Junos OS on EX Series switches and SRX Series devices. An unauthenticated, network-based attacker can submit a crafted request that sets the PHPRC environment variable, altering PHP configuration loading and execution behavior to inject and execute code. Publicly demonstrated exploitation also chains this vulnerability with CVE-2023-36846, an unauthenticated file-upload vulnerability, to load attacker-controlled PHP code. Exploitation has been observed in the wild.

Do you run this?See affected versions in your environment and whether adversaries are exploiting this vulnerability against assets like yours.
Check your exposure
Analyst brief

Impact, mitigation & remediation

What it means and what to do now: patch path, interim mitigations, and the assume-compromise checklist.

Impact

What an attacker gets, and what they’ve been doing with it.

Successful exploitation enables unauthenticated remote code execution on the affected device, compromising the confidentiality and integrity of information accessible to the executing process and potentially disrupting device operation. Observed exploitation attempts also sought disclosure of local account information. Compromise of these network infrastructure devices can provide a foothold for broader network intrusion. The available information does not establish that exploitation inherently grants root privileges.

Mitigation

If you can’t patch tonight, do this now.

Disable J-Web if it is not required. If J-Web must remain enabled, restrict access to trusted administrative hosts and prevent access from the Internet or other untrusted networks. These access restrictions reduce exposure but do not replace installation of a fixed Junos OS release.

Remediation

Patch, then assume compromise.

Install a Juniper-fixed Junos OS release appropriate to the device and release branch: 20.4R3-S9; 21.2R3-S7; 21.3R3-S5; 21.4R3-S5; 22.1R3-S4; 22.2R3-S2; 22.3R2-S2 or 22.3R3-S1; 22.4R2-S1 or 22.4R3; or 23.2R1-S1 or 23.2R2, or a later fixed release in the corresponding branch. The 21.1 branch is affected from 21.1R1 onward, with no fixed 21.1 release identified; migrate affected installations to a supported fixed release.

Public exploits

Exploits

5 exploits validated by Mallory's analysis. Hidden: 7 rejected by Mallory's analysis as not a working exploit; 1 not yet analyzed, such as Exploit-DB entries.

View more in app →
junos_phprc_auto_prepend_file.rbThis repository contains a single Metasploit module targeting Juniper SRX firewalls and EX switches running vulnerable versions of Junos OS (CVE-2023-36845). The exploit leverages PHP environment variable manipulation, specifically abusing the 'auto_prepend_file' and 'allow_url_include' features, to achieve remote code execution via the web interface. The module supports two main attack modes: (1) in-memory PHP payload execution (e.g., Meterpreter reverse shell) within a FreeBSD jail, and (2) a 'jail break' mode that escalates privileges by stealing or creating a J-Web session, changing the root password, and logging in via SSH for full root access, before restoring the original password. The exploit is highly weaponized, supporting customizable payloads and advanced post-exploitation steps. Key fingerprintable endpoints include /dev/fd/0 (for payload delivery), /etc/master.passwd (for password manipulation), and session directories. The module is well-documented, includes multiple configuration options, and is suitable for both proof-of-concept and operational exploitation.Disclosed Aug 17, 2023 · Framework: metasploit · ruby · networkWeaponizedCVE-2023-36845This repository contains a Bash script (cve.sh) and a README.md file. The script is a proof-of-concept exploit for CVE-2023-36845, a vulnerability affecting Juniper SRX and EX Series devices running Junos OS. The exploit works by reading a list of target hosts from a user-supplied file, then sending a crafted HTTP POST request to each host, attempting to leverage the PHPRC parameter to include /etc/passwd. If the response contains 'root:', the target is considered vulnerable and is logged to vuln.txt. The script is designed for batch testing multiple hosts and provides clear output for vulnerable systems. The README provides usage instructions and references to relevant advisories and articles. No weaponized payload is included; the script is a POC for detection and verification of the vulnerability.zaenhaxor · Disclosed Sep 29, 2023 · bash · networkPoCCVE-2023-36845-POCThis repository contains a Python proof-of-concept exploit for CVE-2023-36845, a vulnerability in the J-Web component of Juniper Networks Junos OS (affecting EX and SRX Series devices). The main script, 'CVE-2023-36845-POC.py', reads a list of target hosts from 'hosts.txt' and sends crafted HTTP POST requests to each, attempting to exploit the PHPRC environment variable to read the '/etc/passwd' file from the target system. The exploit leverages concurrent execution to test multiple hosts in parallel. The repository also includes a README with usage instructions, a requirements.txt specifying the 'requests' library, and a GPLv3 license. The exploit is a functional proof-of-concept and does not provide a shell or persistent access, but demonstrates the ability to read sensitive files from vulnerable systems.cyberh3als · Disclosed Oct 2, 2023 · python · networkPoCCVE-2023-36845-Juniper-VulnerabilityThis repository contains a Python proof-of-concept exploit for CVE-2023-36845, a vulnerability in Juniper Networks Junos OS (EX and SRX Series) J-Web component. The exploit targets the PHPRC environment variable manipulation, allowing an attacker to attempt to read arbitrary files (such as /etc/passwd) from vulnerable devices. The main script, 'CVE-2023–36845.py', reads a list of target hosts from 'hosts.txt' (not included in the repo), and concurrently sends crafted HTTP POST requests to each, attempting to exploit the vulnerability. The script prints the HTTP response for each host, which may include sensitive file contents if successful. The repository also includes a README with detailed usage instructions and a requirements.txt specifying the 'requests' library. The exploit is a network-based PoC and does not include weaponized or post-exploitation payloads.0xNehru · Disclosed Feb 14, 2024 · python · networkPoCCVE-2023-36845This repository contains a proof-of-concept exploit for CVE-2023-36845, a remote code execution vulnerability in Juniper Junos OS J-Web. The main file, 'juniperus.py', is a Python3 script that provides an interactive console for exploiting the vulnerability. It allows the attacker to connect to a target Junos device's web interface (over HTTP or HTTPS), and execute limited PHP commands by abusing the PHPRC variable and the 'auto_prepend_file' directive. The exploit currently supports 'ls' (directory listing) and 'cat' (file reading) commands, implemented via PHP's 'scandir' and 'file_get_contents' functions, respectively. The script handles SSL/TLS issues for older Junos devices and allows customization of the Host header, protocol, and port. The README provides a brief description of the exploit. The code is structured for interactive use and is limited by the FreeBSD jail environment on the target, but demonstrates the core RCE capability. No hardcoded IPs or domains are present; the target is specified at runtime. The exploit is a standalone PoC and not part of a framework.kopfjager007 · Disclosed Nov 24, 2025 · python · networkPoC
Exposure surface

Affected products & vendors

Products and vendors Mallory has correlated with this vulnerability. Open in Mallory to drill down to specific CPE configurations and version ranges.

VendorProductType
Juniper NetworksJunosoperating_system
FAQ

Frequently asked questions

Is CVE-2023-36845 exploited in the wild?
Yes. As of Nov 10, 2026, Mallory has reports of exploitation in the wild, and CISA added it to KEV on Nov 13, 2023.
Is there a public exploit for CVE-2023-36845?
Yes. Mallory tracks 5 public exploits or proofs of concept for CVE-2023-36845, the earliest disclosed Aug 17, 2023.
Is there a patch for CVE-2023-36845?
Install a Juniper-fixed Junos OS release appropriate to the device and release branch: 20.4R3-S9; 21.2R3-S7; 21.3R3-S5; 21.4R3-S5; 22.1R3-S4; 22.2R3-S2; 22.3R2-S2 or 22.3R3-S1; 22.4R2-S1 or 22.4R3; or 23.2R1-S1 or 23.2R2, or a later fixed release in the corresponding branch. The 21.1 branch is affected from 21.1R1 onward, with no fixed 21.1 release identified; migrate affected installations to a supported fixed release.
What products are affected by CVE-2023-36845?
Juniper Networks Junos.
How severe is CVE-2023-36845?
CVE-2023-36845 has a CVSS v3.1 score of 9.8 (Critical) and an EPSS score of 91.4% (100th percentile) as of Nov 10, 2026.
Mallory platform

The version that knows your environment.

This page is what’s public. Mallory adds the parts that aren’t: which of your assets are affected, which adversaries are exploiting it right now, and which detections to deploy tonight.
Exposure mappingQuery your assets running an affected version, and investigate the blast radius.
Threat actor evidenceEvery report linking this CVE to a named adversary.
Associated malware1Malware families linked to this CVE, with evidence and IOCs.
Detection signatures5YARA, Sigma, Snort, and vendor rules, auto-deployed to your SIEM.
Vendor-by-vendor mappingCross-references every affected SKU, including bundled OEM variants.
Social activityCommunity discussion across Reddit, Mastodon, and other social sources.