Juniper Networks Junos OS J-Web External Variable Modification Vulnerability (CVE-2023-36845) Remote Code Execution Analysis and Mitigation Guide
Executive & SecOps Summary
SECOPS ASSESSMENTJuniper Networks Junos OS on EX Series switches and SRX Series firewalls with the J-Web interface enabled
An unauthenticated, network-based attacker can modify the PHP execution environment (PHPRC) via crafted HTTP requests, leading to arbitrary code execution and full device compromise
Immediately upgrade Junos OS to the patched versions, or disable the J-Web interface and restrict access to trusted IP addresses as a temporary workaround
Affected Products & Version Scope
Remediation & Live Workaround Commands
PATCH & WORKAROUND1. Official Patch & Version Upgrade Commands
Apply the official Junos OS security updates immediately. Use the following CLI commands to download and install the patched image:
# Download and install the patched Junos OS image (Example for SRX)
request system software add reboot https://downloads.juniper.net/software/junos/22.4R3/junos-srxsme-22.4R3.tgz
# Reboot the system to apply the patch
request system reboot2. Temporary Workaround & Hardening Configuration
If patching cannot be performed immediately, disable J-Web or restrict access to trusted management networks using firewall filters.
# Disable the J-Web service entirely
configure
delete system services web-management
commit and-quit
# Alternatively, restrict J-Web access to a trusted subnet (e.g., 192.168.10.0/24)
configure
set firewall family inet filter MGMT_LIMIT term ALLOW_MGMT from source-address 192.168.10.0/24
set firewall family inet filter MGMT_LIMIT term ALLOW_MGMT from destination-port [ http https ]
set firewall family inet filter MGMT_LIMIT term ALLOW_MGMT then accept
set firewall family inet filter MGMT_LIMIT term DENY_ALL then discard
set interfaces lo0 unit 0 family inet filter input MGMT_LIMIT
commit and-quit3. Log Audit & IoC Verification Commands
Inspect J-Web access logs for indicators of compromise, such as unauthorized environment variable manipulation.
# Search J-Web access logs for PHPRC manipulation attempts
show log httpd-access | match 'PHPRC'
show log httpd-access | match 'env'
# Verify the current Junos OS version and active services
show version
show system servicesStop Exposing VPN Ports to the Internet — Switch to Zero-Trust Access
Eliminate public-facing VPN concentrators and firewall management ports with identity-first Zero-Trust Network Access.
Technical Root Cause & Exploitation Mechanics
1. Vulnerability Overview & Root Cause
This vulnerability (CVE-2023-36845) is a PHP External Variable Modification vulnerability (CWE-473) residing in the J-Web component of Juniper Networks Junos OS. The root cause lies in the J-Web web server's failure to properly sanitize and restrict environment variables passed via HTTP requests. This allows an unauthenticated attacker to set the 'PHPRC' environment variable, which dictates the directory where PHP looks for its configuration file (php.ini).
2. Exploitation Mechanics & Attack Scenario
An attacker sends a specially crafted HTTP POST request to the J-Web interface (typically on port 80 or 443). By injecting the 'PHPRC' variable into the request, the attacker forces the PHP engine to load a malicious configuration file from an arbitrary location (such as a temporary directory or an uploaded file). Once the PHP engine parses this attacker-controlled configuration, it executes arbitrary PHP code or system commands with the privileges of the J-Web web server process, leading to remote code execution.
3. Infrastructure & Business Impact
With a CVSS score of 9.8 (Critical) and its inclusion in CISA's Known Exploited Vulnerabilities (KEV) catalog, this vulnerability poses an immediate threat to enterprise networks. Since SRX firewalls and EX switches serve as critical perimeter and core routing infrastructure, a successful compromise allows attackers to bypass security controls, perform lateral movement, intercept sensitive network traffic, and establish persistent backdoors within the internal network.
Official Vendor Advisories & References
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 remotely execute code. Using a crafted request which sets the variable PHPRC an attacker is able to modify the PHP execution environment allowing the injection und execution of code. This issue affects Juniper Networks Junos OS on EX Series and SRX Series: * All versions prior to 20.4R3-S9; * 21.1 versions 21.1R1 and later; * 21.2 versions prior to 21.2R3-S7; * 21.3 versions prior to 21.3R3-S5; * 21.4 versions prior to 21.4R3-S5; * 22.1 versions prior to 22.1R3-S4; * 22.2 versions prior to 22.2R3-S2; * 22.3 versions prior to 22.3R2-S2, 22.3R3-S1; * 22.4 versions prior to 22.4R2-S1, 22.4R3; * 23.2 versions prior to 23.2R1-S1, 23.2R2.
Frequently Asked SecOps Questions (CVE-2023-36845)
FAQQ1. How critical is CVE-2023-36845 and is it actively exploited in the wild?
CVE-2023-36845 is rated CVSS 9.8 (CRITICAL) with a 30-day EPSS exploitation probability of 95.1%. It is listed in the CISA Known Exploited Vulnerabilities (KEV) catalog, requiring immediate emergency remediation.
Q2. Which vendors and products are affected by CVE-2023-36845?
Primary impacted vendors include juniper across junos_os, ex_series, srx_series. Scope summary: Juniper Networks Junos OS on EX Series and SRX Series with J-Web enabled in the following versions: - All versions prior to 20.4R3-S9 - 21.1 versions 21.1R1 and later - 21.2 versions prior to 21.2R3-S7 - 21.3 versions prior to 21.3R3-S5 - 21.4 versions prior to 21.4R3-S5 - 22.1 versions prior to 22.1R3-S4 - 22.2 versions prior to 22.2R3-S2 - 22.3 versions prior to 22.3R2-S2, 22.3R3-S1 - 22.4 versions prior to 22.4R2-S1, 22.4R3 - 23.2 versions prior to 23.2R1-S1, 23.2R2
Q3. What temporary mitigations or workarounds exist for CVE-2023-36845 before patching?
[Mitigation] Immediately upgrade Junos OS to the patched versions, or disable the J-Web interface and restrict access to trusted IP addresses as a temporary workaround Follow the CLI remediation commands and interactive SecOps checklist on this page to restrict exposure prior to your maintenance window.
Generate an Internal Engineering Notice or CISO Report for CVE-2023-36845
Instantly format this advisory into an executive CISO summary or engineering patch ticket.
🔗 Related Advisories in Similar Stack (juniper)
View Category →Arista VeloCloud Orchestrator (VCO) Remote Code Execution and Privilege Escalation (CVE-2026-93952)
[Affected Scope] Arista VeloCloud Orchestrator (VCO) On-premise deployments.
Cisco Identity Services Engine (ISE) Critical Authentication Bypass Vulnerability (CVE-2026-76460)
[Affected Scope] Cisco Identity Services Engine (ISE) web-based management interface and API endpoints.
SonicWall SMA1000 Work Place Pre-Authentication Server-Side Request Forgery (SSRF) Vulnerability (CVE-2026-83548)
[Affected Scope] SonicWall SMA1000 Series Appliance Work Place interface
Arista VeloCloud Orchestrator (VCO) On-Premises Remote Code Execution and Privilege Bypass (CVE-2026-16812)
[Affected Scope] On-premises deployments of VeloCloud Orchestrator (VCO)
Subscribe to Daily Vulnerability Briefings & KEV Alerts
Concise morning briefings for SecOps, DevSecOps, and SRE teams covering newly exploited CVEs and mitigation priorities.