Bug 1631102 (CVE-2018-11786)

Summary: CVE-2018-11786 karaf: SSH RBAC security enforcement
Product: [Other] Security Response Reporter: Pedro Sampaio <psampaio>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED ERRATA QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: aileenc, apevec, chazlett, chrisw, gvarsami, jcoleman, jjoyce, jschluet, ldimaggi, lhh, lpeer, markmc, mburns, mkolesni, nwallace, rbryant, rwagner, sclewis, slinaber, tcunning, tdecacqu, tkirby
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Karaf 4.2.0 Doc Type: If docs needed, set a value
Doc Text:
In Karaf prior to version 4.2.0, arbitrary file read and write, in additional to arbitrary command execution, is possible via the Karaf ssh console, if enabled.
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-10-21 19:53:46 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1654109, 1654111, 1654112, 1654113, 1654114    
Bug Blocks: 1631103    

Description Pedro Sampaio 2018-09-19 21:35:28 UTC
As reported by upstream:

"A new security advisory has been released for Apache Karaf, that is
fixed in recent 4.2.0 release.

CVS-2018-11786: Apache Karaf SSH RBAC security enforcement

Severity: Moderate

Vendor: The Apache Software Foundation

Versions Affected: all versions of Apache Karaf prior to 4.2.0.M1

Description:

If the sshd service in Karaf is left on so an administrator can manage
the running instance, any user with rights to the Karaf console can
pivot and read/write any file on the file system to which the Karaf
process user has access. This can be locked down a bit by using chroot
to change the root directory to protect files outside of the Karaf
install directory; it can be further locked down by defining a
security manager policy that limits file system access to those
directories beneath the Karaf home that are necessary for the system
to run. However, this still allows anyone with ssh access to the Karaf
process to read and write a large number of files as the Karaf process
user.


This has been fixed in revision:

https://gitbox.apache.org/repos/asf?p=karaf.git;h=24fb477
https://gitbox.apache.org/repos/asf?p=karaf.git;h=7ad0da3

Mitigation: Apache Karaf users should upgrade to 4.2.0.M1 or later as
soon as possible.

JIRA Tickets: https://issues.apache.org/jira/browse/KARAF-5427

Credit: This issue was reported by R.A. Porter"


External references:

http://karaf.apache.org/security/cve-2018-11786.txt

Comment 1 James Hebden 2018-11-28 02:45:33 UTC
Impacted:
RHOSP 8:  org.apache.karaf-karaf-4.0.3.1                                                                      
RHOSP 9:  org.apache.karaf-karaf-3.0.1.1                                                                      
RHOSP 10: org.apache.karaf-karaf-3.0.3.1                                                                     
RHOSP 12: org.apache.karaf-karaf-4.0.7.1    
RHOSP13:  org.apache.karaf-karaf-4.1.5.1 
 
OpenDaylight in RHOSP are shipping vulnerable versions and enabling the functionality required to use this vulnerability to gain code execution in the context of the odl service account.

By default, Open Daylight enables the SSH console on port 8101, with default credentials. As a result, arbitrary code execution is possible with the default login (karaf:karaf). For example:

ssh -v karaf@<odl controller IP> -p 8101
opendaylight-user@root> exec whoami
odl (we are not running as root in the OS context, but the odl service user)

The only constraints applicable to code execution is that the execution does not occur as an administrative user unless Open Daylight has been specifically configured to run under such an account.
Applying the recommended patches developed upstream to limit access based on RBAC mitigates this, full shell access should be granted explicitly or disabled by default.

Comment 2 James Hebden 2018-11-28 02:45:44 UTC
Statement:

Open Daylight: The SSH console is enabled by default, with default credentials, and allows arbitrary file read and write, in addition to arbitrary command execution, in addition to regular Open Daylight Karaf functions.

Comment 5 Joshua Padman 2019-05-15 22:48:49 UTC
This vulnerability is out of security support scope for the following products:
 * Red Hat JBoss A-MQ 6
 * Red Hat JBoss Fuse 6

Please refer to https://access.redhat.com/support/policy/updates/jboss_notes for more details.