The SentinelOne Annual Threat Report - A Defenders Guide from the FrontlinesThe SentinelOne Annual Threat ReportGet the Report
Experiencing a Breach?Blog
Get StartedContact Us
SentinelOne
  • Platform
    Platform Overview
    • Singularity Platform
      Welcome to Integrated Enterprise Security
    • AI for Security
      Leading the Way in AI-Powered Security Solutions
    • Securing AI
      Accelerate AI Adoption with Secure AI Tools, Apps, and Agents.
    • How It Works
      The Singularity XDR Difference
    • Singularity Marketplace
      One-Click Integrations to Unlock the Power of XDR
    • Pricing & Packaging
      Comparisons and Guidance at a Glance
    Data & AI
    • Purple AI
      Accelerate SecOps with Generative AI
    • Singularity Hyperautomation
      Easily Automate Security Processes
    • AI-SIEM
      The AI SIEM for the Autonomous SOC
    • Singularity Data Lake
      AI-Powered, Unified Data Lake
    • Singularity Data Lake for Log Analytics
      Seamlessly Ingest Data from On-Prem, Cloud or Hybrid Environments
    Endpoint Security
    • Singularity Endpoint
      Autonomous Prevention, Detection, and Response
    • Singularity XDR
      Native & Open Protection, Detection, and Response
    • Singularity RemoteOps Forensics
      Orchestrate Forensics at Scale
    • Singularity Threat Intelligence
      Comprehensive Adversary Intelligence
    • Singularity Vulnerability Management
      Application & OS Vulnerability Management
    • Singularity Identity
      Identity Threat Detection and Response
    Cloud Security
    • Singularity Cloud Security
      Block Attacks with an AI-Powered CNAPP
    • Singularity Cloud Native Security
      Secure Cloud and Development Resources
    • Singularity Cloud Workload Security
      Real-Time Cloud Workload Protection Platform
    • Singularity Cloud Data Security
      AI-Powered Threat Detection for Cloud Storage
    • Singularity Cloud Security Posture Management
      Detect and Remediate Cloud Misconfigurations
    Securing AI
    • Prompt Security
      Secure AI Tools Across Your Enterprise
  • Why SentinelOne?
    Why SentinelOne?
    • Why SentinelOne?
      Cybersecurity Built for What’s Next
    • Our Customers
      Trusted by the World’s Leading Enterprises
    • Industry Recognition
      Tested and Proven by the Experts
    • About Us
      The Industry Leader in Autonomous Cybersecurity
    Compare SentinelOne
    • Arctic Wolf
    • Broadcom
    • CrowdStrike
    • Cybereason
    • Microsoft
    • Palo Alto Networks
    • Sophos
    • Splunk
    • Trellix
    • Trend Micro
    • Wiz
    Verticals
    • Energy
    • Federal Government
    • Finance
    • Healthcare
    • Higher Education
    • K-12 Education
    • Manufacturing
    • Retail
    • State and Local Government
  • Services
    Managed Services
    • Managed Services Overview
      Wayfinder Threat Detection & Response
    • Threat Hunting
      World-Class Expertise and Threat Intelligence
    • Managed Detection & Response
      24/7/365 Expert MDR Across Your Entire Environment
    • Incident Readiness & Response
      DFIR, Breach Readiness, & Compromise Assessments
    Support, Deployment, & Health
    • Technical Account Management
      Customer Success with Personalized Service
    • SentinelOne GO
      Guided Onboarding & Deployment Advisory
    • SentinelOne University
      Live and On-Demand Training
    • Services Overview
      Comprehensive Solutions for Seamless Security Operations
    • SentinelOne Community
      Community Login
  • Partners
    Our Network
    • MSSP Partners
      Succeed Faster with SentinelOne
    • Singularity Marketplace
      Extend the Power of S1 Technology
    • Cyber Risk Partners
      Enlist Pro Response and Advisory Teams
    • Technology Alliances
      Integrated, Enterprise-Scale Solutions
    • SentinelOne for AWS
      Hosted in AWS Regions Around the World
    • Channel Partners
      Deliver the Right Solutions, Together
    • SentinelOne for Google Cloud
      Unified, Autonomous Security Giving Defenders the Advantage at Global Scale
    • Partner Locator
      Your Go-to Source for Our Top Partners in Your Region
    Partner Portal→
  • Resources
    Resource Center
    • Case Studies
    • Data Sheets
    • eBooks
    • Reports
    • Videos
    • Webinars
    • Whitepapers
    • Events
    View All Resources→
    Blog
    • Feature Spotlight
    • For CISO/CIO
    • From the Front Lines
    • Identity
    • Cloud
    • macOS
    • SentinelOne Blog
    Blog→
    Tech Resources
    • SentinelLABS
    • Ransomware Anthology
    • Cybersecurity 101
  • About
    About SentinelOne
    • About SentinelOne
      The Industry Leader in Cybersecurity
    • Investor Relations
      Financial Information & Events
    • SentinelLABS
      Threat Research for the Modern Threat Hunter
    • Careers
      The Latest Job Opportunities
    • Press & News
      Company Announcements
    • Cybersecurity Blog
      The Latest Cybersecurity Threats, News, & More
    • FAQ
      Get Answers to Our Most Frequently Asked Questions
    • DataSet
      The Live Data Platform
    • S Foundation
      Securing a Safer Future for All
    • S Ventures
      Investing in the Next Generation of Security, Data and AI
  • Pricing
Get StartedContact Us
CVE Vulnerability Database
Vulnerability Database/CVE-2021-31385

CVE-2021-31385: Juniper Junos Privilege Escalation Flaw

CVE-2021-31385 is a path traversal privilege escalation vulnerability in Juniper Junos J-Web that allows low-privileged attackers to gain root access. This article covers technical details, affected versions, and fixes.

Published: February 25, 2026

CVE-2021-31385 Overview

CVE-2021-31385 is a Path Traversal vulnerability (CWE-22) affecting the J-Web management interface in Juniper Networks Junos OS. This vulnerability enables any low-privileged authenticated attacker to escalate their privileges to root on affected devices. The J-Web interface is the web-based management GUI for Junos OS devices, commonly used by network administrators for device configuration and monitoring.

The vulnerability stems from an Improper Limitation of a Pathname to a Restricted Directory condition within J-Web, which fails to properly sanitize user-supplied input in file path operations. When exploited, an attacker with minimal access to the web interface can traverse directory structures and access or manipulate files outside the intended restricted directory, ultimately achieving root-level access to the underlying system.

Critical Impact

Low-privileged authenticated attackers can escalate to root privileges on Juniper network devices, potentially gaining complete control over critical network infrastructure.

Affected Products

  • Juniper Networks Junos OS 12.3 versions prior to 12.3R12-S19
  • Juniper Networks Junos OS 15.1 versions prior to 15.1R7-S10
  • Juniper Networks Junos OS 18.3 versions prior to 18.3R3-S5
  • Juniper Networks Junos OS 18.4 versions prior to 18.4R3-S9
  • Juniper Networks Junos OS 19.1 versions prior to 19.1R3-S6
  • Juniper Networks Junos OS 19.2 versions prior to 19.2R1-S7 or 19.2R3-S3
  • Juniper Networks Junos OS 19.3 versions prior to 19.3R3-S3
  • Juniper Networks Junos OS 19.4 versions prior to 19.4R3-S5
  • Juniper Networks Junos OS 20.1 versions prior to 20.1R2-S2 or 20.1R3-S1
  • Juniper Networks Junos OS 20.2 versions prior to 20.2R3-S2
  • Juniper Networks Junos OS 20.3 versions prior to 20.3R3
  • Juniper Networks Junos OS 20.4 versions prior to 20.4R2-S1 or 20.4R3
  • Juniper Networks Junos OS 21.1 versions prior to 21.1R1-S1 or 21.1R2

Discovery Timeline

  • October 19, 2021 - CVE-2021-31385 published to NVD
  • November 21, 2024 - Last updated in NVD database

Technical Details for CVE-2021-31385

Vulnerability Analysis

This path traversal vulnerability exists within the J-Web management interface, which is the web-based GUI provided by Junos OS for device administration. The vulnerability allows authenticated users, even those with minimal privileges, to bypass intended access restrictions by manipulating file path parameters in HTTP requests to the J-Web interface.

Path traversal attacks exploit insufficient input validation when the application processes file paths. By inserting directory traversal sequences (such as ../) into file path parameters, an attacker can navigate outside the application's intended directory scope and access sensitive system files or execute privileged operations.

The privilege escalation aspect of this vulnerability is particularly severe because network devices running Junos OS typically serve critical infrastructure functions—routing, firewall enforcement, and network segmentation. Root access to such devices could enable an attacker to intercept or modify network traffic, disable security controls, pivot to other network segments, or cause widespread network outages.

Root Cause

The root cause of CVE-2021-31385 is improper input validation and sanitization of pathname parameters within the J-Web application. The J-Web interface fails to adequately restrict user-supplied input when constructing file paths, allowing directory traversal sequences to escape the intended restricted directory structure. This lack of canonicalization and path validation enables attackers to reference files and directories outside the web application's designated scope, ultimately reaching system-level files that can be leveraged for privilege escalation.

Attack Vector

The attack is network-accessible and requires authentication, though only low-privilege credentials are necessary. An attacker would:

  1. Authenticate to the J-Web management interface using any valid low-privileged account
  2. Craft malicious HTTP requests containing path traversal sequences in vulnerable parameters
  3. Use the traversal capability to access or manipulate sensitive system files
  4. Leverage file access to escalate privileges to root

The attack does not require user interaction beyond the initial authentication. Given that J-Web interfaces are often exposed to management networks and sometimes inadvertently to the internet, the attack surface can be significant. The path traversal vulnerability allows the attacker to escape the web application's sandbox and interact with the underlying Junos OS at the file system level, enabling root-level privilege escalation.

Detection Methods for CVE-2021-31385

Indicators of Compromise

  • Anomalous HTTP requests to J-Web containing path traversal sequences such as ../, ..%2f, or URL-encoded variants
  • Unexpected file access patterns in J-Web server logs, particularly requests targeting paths outside /var/www/ or expected web directories
  • Authentication events from J-Web followed by suspicious privilege changes or root-level operations
  • Log entries indicating access to sensitive system files like /etc/passwd, /etc/shadow, or configuration files from J-Web context

Detection Strategies

  • Implement web application firewall (WAF) rules to detect and block path traversal patterns in HTTP requests to J-Web interfaces
  • Monitor J-Web access logs for requests containing sequences like ../, ..%2f, %2e%2e/, and similar encoding variants
  • Deploy network intrusion detection systems (IDS) with signatures for path traversal attacks targeting Juniper devices
  • Correlate authentication logs with privilege escalation events to identify potential exploitation attempts

Monitoring Recommendations

  • Enable detailed logging for all J-Web authentication and authorization events
  • Configure SIEM alerts for path traversal indicators in HTTP request URLs and parameters targeting Juniper management interfaces
  • Regularly audit user accounts with J-Web access and review for suspicious privilege changes
  • Monitor for unexpected root-level process execution following J-Web sessions

How to Mitigate CVE-2021-31385

Immediate Actions Required

  • Upgrade to patched Junos OS versions as specified by Juniper Networks Security Advisory JSA11253
  • If immediate patching is not possible, disable J-Web interface access until patches can be applied
  • Restrict J-Web access to trusted management networks only using ACLs and firewall rules
  • Audit all user accounts with J-Web access and remove unnecessary privileges
  • Review logs for any signs of prior exploitation attempts

Patch Information

Juniper Networks has released security patches addressing this vulnerability across all affected Junos OS versions. Organizations should upgrade to the following minimum versions:

  • Junos OS 12.3R12-S19 or later
  • Junos OS 15.1R7-S10 or later
  • Junos OS 18.3R3-S5 or later
  • Junos OS 18.4R3-S9 or later
  • Junos OS 19.1R3-S6 or later
  • Junos OS 19.2R1-S7, 19.2R3-S3, or later
  • Junos OS 19.3R3-S3 or later
  • Junos OS 19.4R3-S5 or later
  • Junos OS 20.1R2-S2, 20.1R3-S1, or later
  • Junos OS 20.2R3-S2 or later
  • Junos OS 20.3R3 or later
  • Junos OS 20.4R2-S1, 20.4R3, or later
  • Junos OS 21.1R1-S1, 21.1R2, or later

Refer to the Juniper Security Advisory JSA11253 for complete details on patched versions and upgrade instructions.

Workarounds

  • Disable J-Web entirely if web-based management is not required: use CLI management via SSH instead
  • Implement strict access control lists (ACLs) limiting J-Web access to specific trusted IP addresses or management subnets
  • Deploy a reverse proxy with path traversal filtering in front of J-Web interfaces
  • Use firewall rules to block external access to J-Web management ports (typically TCP/80 and TCP/443 on the management interface)
bash
# Disable J-Web on Junos OS
configure
delete system services web-management
commit

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

  • Vulnerability Details
  • TypePrivilege Escalation

  • Vendor/TechJuniper Junos

  • SeverityHIGH

  • CVSS Score8.8

  • EPSS Probability0.71%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityNone
  • AvailabilityHigh
  • CWE References
  • CWE-22
  • Vendor Resources
  • Juniper Security Advisory JSA11253
  • Related CVEs
  • CVE-2025-21590: Juniper Junos Privilege Escalation Flaw

  • CVE-2021-31372: Juniper Junos Privilege Escalation Flaw

  • CVE-2021-0223: Juniper Junos Privilege Escalation Flaw

  • CVE-2024-21586: Juniper Junos DoS Vulnerability
Experience the World’s Most Advanced Cybersecurity Platform

Experience the World’s Most Advanced Cybersecurity Platform

See how our intelligent, autonomous cybersecurity platform can protect your organization now and into the future.

Try SentinelOne
  • Get Started
  • Get a Demo
  • Product Tour
  • Why SentinelOne
  • Pricing & Packaging
  • FAQ
  • Contact
  • Contact Us
  • Customer Support
  • SentinelOne Status
  • Language
  • Platform
  • Singularity Platform
  • Singularity Endpoint
  • Singularity Cloud
  • Singularity AI-SIEM
  • Singularity Identity
  • Singularity Marketplace
  • Purple AI
  • Services
  • Wayfinder TDR
  • SentinelOne GO
  • Technical Account Management
  • Support Services
  • Verticals
  • Energy
  • Federal Government
  • Finance
  • Healthcare
  • Higher Education
  • K-12 Education
  • Manufacturing
  • Retail
  • State and Local Government
  • Cybersecurity for SMB
  • Resources
  • Blog
  • Labs
  • Case Studies
  • Videos
  • Product Tours
  • Events
  • Cybersecurity 101
  • eBooks
  • Webinars
  • Whitepapers
  • Press
  • News
  • Ransomware Anthology
  • Company
  • About Us
  • Our Customers
  • Careers
  • Partners
  • Legal & Compliance
  • Security & Compliance
  • Investor Relations
  • S Foundation
  • S Ventures

©2026 SentinelOne, All Rights Reserved.

Privacy Notice Terms of Use

English