Juniper JunOS RCE Flaw Let Unauthenticated Remote Attacker Execute Code

The J-Web component of Juniper Networks’ Junos OS has been discovered to contain a number of vulnerabilities, one or more of which may allow remote code execution, cross-site scripting attacks, route injection, traversal, or local file inclusion.

According to Octagon Networks, “Chief among them is a remote pre-authenticated PHP archive file deserialization vulnerability (CVE-2022-22241, CVSS score: 8.1) in the J-Web component of Junos OS”.

Details of Vulnerabilities

CVE-2022-22241: Remote pre-authenticated Phar Deserialization to RCE- (CVSS score: 8.1)

“An Improper Input Validation vulnerability in the J-Web component of Juniper Networks Junos OS may allow an unauthenticated attacker to access data without proper authorization”, Juniper Networks

When parsed by a PHP file operation function, the metadata in Phar files (PHP Archive) files is deserialized because it is stored in a serialized format. 

Reports say this behavior can be abused by an attacker to take advantage of a Juniper codebase object instantiation vulnerability.

Notably, deserialization will take place even using PHP functions that do not eval PHP code like file_get_contents(), fopen(), file() or file_exists(), md5_file(), filemtime() or filesize(), is_dir(), if user input is passed to the functions.

An unauthenticated remote attacker can make use of this vulnerability to have remote phar files deserialized, which results in arbitrary file writing and a remote code execution (RCE) vulnerability.

CVE-2022-22242: pre-authenticated reflected XSS on the error page- (CVSS score: 6.1)

This is a Cross-site Scripting (XSS) vulnerability found in the J-Web component of Juniper Networks Junos OS allows an unauthenticated attacker to run malicious scripts reflected off of J-Web to the victim’s browser in the context of their session within J-Web.

This flaw can be used with other vulnerabilities that require authentication or allow a remote unauthenticated attacker to steal JunOS admin sessions.

CVE-2022-22243– (CVSS score: 4.3) and & CVE-2022-22244 – (CVSS score: 5.3): XPATH Injection

It is an XPath Injection vulnerability caused due to Improper Input Validation in the J-Web component of Juniper Networks Junos OS. 

This allows an attacker to add an XPath command to the XPath stream that let chaining to other unspecified vulnerabilities, leading to a partial loss of confidentiality.

It can be exploited by a remote authenticated attacker to manipulate JunOS admin sessions or manipulate the XPATH stream that the server uses to talk with its XML parsers.

CVE-2022-22245: Path traversal during file upload leads to RCE – (CVSS score: 4.3)

This is a Path Traversal vulnerability in the J-Web component of Juniper Networks Junos OS. It allows attackers to upload arbitrary files to the device by bypassing validation checks built into Junos OS. 

The successful exploitation of this vulnerability could lead to loss of filesystem integrity. Reports say this flaw can be exploited by attackers to execute PHP code by uploading a file with a special name.

CVE-2022-22246: PHP Local File Inclusion (LFI) vulnerability – (CVSS score: 7.5)

This PHP Local File Inclusion (LFI) vulnerability was found in the J-Web component of Juniper Networks Junos OS. This may allow a low-privileged authenticated attacker to execute an untrusted PHP file. The successful exploitation could lead to a complete system compromise.

Fix Available

The issues are addressed in Junos OS versions 19.1R3-S9, 19.2R3-S6, 19.3R3-S7, 19.4R3-S9, 20.1R3-S5, 20.2R3-S5, 20.3R3-S5, 20.4R3-S4, 21.1R3-S2, 21.3R3, 21.4R3, 22.1R2, 22.2R1, and later.

Therefore, the users are recommended to apply the software patch available for Junos OS as early as possible to prevent the abovementioned threats.

Gurubaran

Gurubaran is a co-founder of Cyber Security News and GBHackers On Security. He has 10+ years of experience as a Security Consultant, Editor, and Analyst in cybersecurity, technology, and communications.

Recent Posts

MITRE ATT&CK Evaluation Results 2024 – Cynet Became a Leader With 100% Detection & Protection

Across small-to-medium enterprises (SMEs) and managed service providers (MSPs), the top priority for cybersecurity leaders…

2 hours ago

Antidot Malware Attacking Employees Android Devices To Inject Malicious Payloads

Researchers discovered a new variant of the AntiDot banking trojan targeting Android mobile devices through…

6 hours ago

Triad Nexus, Chinese Hackers Using 200,000 Domains For Widespread Cyber Attack

Researchers identified FUNNULL, a Chinese CDN, as hosting malicious content, which includes fake trading apps…

6 hours ago

Malicious ESLint Package Let Attackers Steal Data And Inject Remote Code

Cybercriminals exploited typosquatting to deploy a malicious npm package, `@typescript_eslinter/eslint`, targeting developers seeking the legitimate…

6 hours ago

New Chinese Surveillance Tool Attack Android Users Since 2017

Wuhan Chinasoft Token Information Technology Co., Ltd. developed EagleMsgSpy, a surveillance tool operational since 2017,…

6 hours ago

ConvoC2 – A Red Teamers Tool To Execute Commands on Hacked Hosts Via Microsoft Teams

A stealthy Command-and-Control (C2) infrastructure Red Team tool named ConvoC2 showcases how cyber attackers can…

8 hours ago