title: Junos OS: Unauthenticated remote root access possible when RSH service is enabled
description: If RSH service is enabled on Junos OS and if the PAM authentication is disabled, a remote unauthenticated attacker can obtain root access to the device. RSH service is disabled by default on Junos. There is no documented CLI command to enable this service. However, an undocumented CLI command allows a privileged Junos user to enable RSH service and disable PAM, and hence expose the system to unauthenticated root access. When RSH is enabled, the device is listing to RSH connections on port 514. This issue is not exploitable on platforms where Junos release is based on FreeBSD 10+. Affected releases are Juniper Networks Junos OS: 12.1X46 versions prior to 12.1X46-D77 on SRX Series; 12.3 versions prior to 12.3R12-S10; 12.3X48 versions prior to 12.3X48-D75 on SRX Series; 14.1X53 versions prior to 14.1X53-D47 on QFX/EX Series; 15.1 versions prior to 15.1R4-S9, 15.1R6-S6, 15.1R7; 15.1X49 versions prior to 15.1X49-D131, 15.1X49-D140 on SRX Series; 15.1X53 versions prior to 15.1X53-D59 on EX2300/EX3400 Series; 15.1X53 versions prior to 15.1X53-D67 on QFX10K Series; 15.1X53 versions prior to 15.1X53-D233 on QFX5200/QFX5110 Series; 15.1X53 versions prior to 15.1X53-D471, 15.1X53-D490 on NFX Series; 16.1 versions prior to 16.1R3-S9, 16.1R4-S9, 16.1R5-S4, 16.1R6-S4, 16.1R7; 16.2 versions prior to 16.2R2-S5; 17.1 versions prior to 17.1R1-S7, 17.1R2-S7, 17.1R3; 17.2 versions prior to 17.2R1-S6, 17.2R2-S4, 17.2R3; 17.2X75 versions prior to 17.2X75-D110, 17.2X75-D91; 17.3 versions prior to 17.3R1-S4, 17.3R2-S2, 17.3R3; 17.4 versions prior to 17.4R1-S3, 17.4R2; 18.2X75 versions prior to 18.2X75-D5.
problem types: Unauthenticated remote root access
affected:
{
platforms: SRX Series
product: Junos OS
vendor: Juniper Networks
versions:
lessThan: 12.1X46-D77, status: affected, version: 12.1X46, versionType: custom
lessThan: 12.3X48-D75, status: affected, version: 12.3X48, versionType: custom
lessThan: 15.1X49-D131, 15.1X49-D140, status: affected, version: 15.1X49, versionType: custom
}
{
product: Junos OS
vendor: Juniper Networks
versions:
lessThan: 12.3R12-S10, status: affected, version: 12.3, versionType: custom
lessThan: 15.1R4-S9, 15.1R6-S6, 15.1R7, status: affected, version: 15.1, versionType: custom
lessThan: 16.1R3-S9, 16.1R4-S9, 16.1R5-S4, 16.1R6-S4, 16.1R7, status: affected, version: 16.1, versionType: custom
lessThan: 16.2R2-S5, status: affected, version: 16.2, versionType: custom
lessThan: 17.1R1-S7, 17.1R2-S7, 17.1R3, status: affected, version: 17.1, versionType: custom
lessThan: 17.2R1-S6, 17.2R2-S4, 17.2R3, status: affected, version: 17.2, versionType: custom
lessThan: 17.2X75-D110, 17.2X75-D91, status: affected, version: 17.2X75, versionType: custom
lessThan: 17.3R1-S4, 17.3R2-S2, 17.3R3, status: affected, version: 17.3, versionType: custom
lessThan: 17.4R1-S3, 17.4R2, status: affected, version: 17.4, versionType: custom
lessThan: 18.2X75-D5, status: affected, version: 18.2X75, versionType: custom
}
{
platforms: QFX/EX Series
product: Junos OS
vendor: Juniper Networks
versions:
lessThan: 14.1X53-D47, status: affected, version: 14.1X53, versionType: custom
}
{
platforms: EX2300/EX3400 Series
product: Junos OS
vendor: Juniper Networks
versions:
lessThan: 15.1X53-D59, status: affected, version: 15.1X53, versionType: custom
}
{
platforms: QFX10K Series
product: Junos OS
vendor: Juniper Networks
versions:
lessThan: 15.1X53-D67, status: affected, version: 15.1X53, versionType: custom
}
{
platforms: QFX5200/QFX5110 Series
product: Junos OS
vendor: Juniper Networks
versions:
lessThan: 15.1X53-D233, status: affected, version: 15.1X53, versionType: custom
}
{
platforms: NFX Series
product: Junos OS
vendor: Juniper Networks
versions:
lessThan: 15.1X53-D471, 15.1X53-D490, status: affected, version: 15.1X53, versionType: custom
}
metrics:
cvssV3_0: [
attackComplexity: LOW
attackVector: NETWORK
availabilityImpact: HIGH
baseScore: 7.2
baseSeverity: HIGH
confidentialityImpact: HIGH
integrityImpact: HIGH
privilegesRequired: HIGH
scope: UNCHANGED
userInteraction: NONE
vectorString: CVSS:3.0/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H
version: 3.0
]
exploits: Juniper SIRT is not aware of any malicious exploitation of this vulnerability.
solutions: This CLI option has been removed from the fixed Junos releases.
The following software releases have been updated to resolve this specific issue: 12.1X46-D77, 12.3R12-S10, 12.3X48-D75, 14.1X53-D47, 15.1R4-S9, 15.1R6-S6, 15.1R7, 15.1X49-D131, 15.1X49-D140, 15.1X53-D233, 15.1X53-D471, 15.1X53-D490, 15.1X53-D59, 15.1X53-D67, 16.1R3-S9, 16.1R4-S9, 16.1R5-S4, 16.1R6-S4, 16.1R7, 16.2R2-S5, 17.1R1-S7, 17.1R2-S7, 17.1R3, 17.2R1-S6, 17.2R2-S4, 17.2R3, 17.2X75-D110, 17.2X75-D91, 17.3R1-S4, 17.3R2-S2, 17.3R3, 17.4R1-S3, 17.4R2, 18.1R1, 18.2R1, 18.2X75-D5, and all subsequent releases.
workarounds: Ensure there is no RSH service listening on port 514.
Utilize common security BCPs to limit the exploitable surface by limiting access to network and device to trusted systems, administrators, networks and hosts.