2012-07 Security Bulletin: Junos: Loading factory-default from exclusive edit causes escalation of privileges

Legacy Advisory Id:PSN-2012-07-646

Product Affected:This issue can affect any Junos configuration utilizing user class restrictions.

Problem:An escalation of privileges can occur when the ‘load factory-default’ command fails while in exclusive edit mode. When the load command fails, the user is no longer subject to any command and/or configuration restrictions. The escalation is limited to authenticated users with the ability to edit the configuration in the first place. The privilege bypass is specific to configured classes of CLI users with restrictions such as ‘allow-commands’, ‘deny-commands’, and ‘deny-configuration’. For example:
class readonly {
permissions [ clear network reset trace view ];
}
class readwrite {
permissions all;
allow-commands “(configure|edit) exclusive”;
deny-commands “(^start)|(configure$|edit$)|((configure|edit) (private|dynamic));”;
deny-configuration “(system login class)|(system root-authentication)|(system login user .+ class)”;
}
user homer {
uid 1001;
class readwrite;
}
}
user bart {
uid 1002;
class readonly;
}
After user “homer” above executes ‘load factory-default’ while in exclusive edit mode, the command fails and the user “homer” is no longer limited to commands or configurations as defined by the user class. Juniper SIRT is not aware of any malicious exploitation of this vulnerability. No other Juniper Networks products or platforms are affected by this issue.

Solution:Resolved issue where the user performing a ‘load’ command was not being recognized as the same user who had an exclusive lock on the database. All Junos OS software releases built on or after 2012-06-01 have fixed this specific issue. Releases containing the fix specifically include: 10.0S26, 10.4R10, 11.2R7, 11.3R6, 11.4R3, 12.1X44-D15, 12.1X45-D10, 12.1R2, and all subsequent releases (i.e. all releases built after 12.1R2). This issue is being tracked as PR 743545 and is visible on the Customer Support website. KB16765 – “In which releases are vulnerabilities fixed?” describes which release vulnerabilities are fixed as per our End of Engineering and End of Life support policies.

Workaround:Deny access to the ‘load factory-default’ command. For example:
class lfd-workaround {
permissions all;
deny-commands “load factory-default”;
}

Implementation:How to obtain fixed software: Security vulnerabilities in Junos are fixed in the next available Maintenance Release of each supported Junos version. In some cases, a Maintenance Release is not planned to be available in an appropriate time-frame. For these cases, Service Releases are made available in order to be more timely. Security Advisory and Security Notices will indicate which Maintenance and Service Releases contain fixes for the issues described. Upon request to JTAC, customers will be provided download instructions for a Service Release. Although Juniper does not provide formal Release Note documentation for a Service Release, a list of “PRs fixed” can be provided on request.

Related Links: CVSS Score:6.3 (AV:L/AC:M/Au:M/C:C/I:C/A:C)

Risk Level:Medium

Risk Assessment:Information for how Juniper Networks uses CVSS can be found at KB 16446 “Common Vulnerability Scoring System (CVSS) and Juniper’s Security Advisories.”

Acknowledgements: 

Leave a Reply