CVE DatabaseCVE-2023-36845
한국어 권고문 →
CVE-2023-368459.8/CRITICALCISA KEVCWE-473

Juniper Networks Junos OS J-Web External Variable Modification Vulnerability (CVE-2023-36845) Remote Code Execution Analysis and Mitigation Guide

⚡ Jump to Patch
Affected Vendors
juniper
Affected Components
junos_os, ex_series, srx_series
Published Date
2023-08-17
CVSS v3.1
9.8
CRITICAL
EPSS (30d)
95.1%
FIRST.org
CISA KEV
Exploited

Executive & SecOps Summary

SECOPS ASSESSMENT
Affected Scope

Juniper Networks Junos OS on EX Series switches and SRX Series firewalls with the J-Web interface enabled

Impact

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

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

Affected Products & Version Scope

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

Remediation & Live Workaround Commands

PATCH & WORKAROUND

1. 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:

bash
# 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 reboot

2. Temporary Workaround & Hardening Configuration

If patching cannot be performed immediately, disable J-Web or restrict access to trusted management networks using firewall filters.

bash
# 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-quit

3. Log Audit & IoC Verification Commands

Inspect J-Web access logs for indicators of compromise, such as unauthorized environment variable manipulation.

bash
# 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 services
Interactive SecOps Remediation Checklist
0/4 (0%)
Recommended Security Control & Mitigation Partner
NordLayer / Zero-Trust Network Access
Due to active exploitation in the wild, immediately disable J-Web or upgrade your Junos OS to a patched release.

Stop 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.

90% Attack Surface Reduction · Hardware-Free

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

NVD Original English Description

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)

FAQ

Q1. 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.

SECOPS WORKBENCH INTEGRATION

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.

Generate Report →

🔗 Related Advisories in Similar Stack (juniper)

View Category →
SecOps Advisory Dispatch & RSS Feed

Subscribe to Daily Vulnerability Briefings & KEV Alerts

Concise morning briefings for SecOps, DevSecOps, and SRE teams covering newly exploited CVEs and mitigation priorities.

Slack / Teams / RSS Feed:
PatchKO
CVE-2023-36845 Juniper Networks Junos OS J-Web External Variable Modification Vulnerability (CVE-2023-36845) Remote Code Execution Analysis and Mitigation Guide (CVSS 9.8) - Patch & Workaround | CVE Pulse