Apache ActiveMQ (版本 < 5.18.3) (CNVD-2023-69477)RCE修复方案/缓解方案

一、漏洞描述

Apache ActiveMQ 是美国阿帕奇(Apache)基金会的一套开源的消息中间件,它支持 Java 消息服务、集群、Spring Framework 等。

二、漏洞成因

ActiveMQ 默认开放了 61616 端口用于接收 OpenWire 协议消息,由于针对异常消息的处理存在反射调用逻辑,攻击者可能通过构造恶意的序列化消息数据加载恶意类,执行任意代码。

三、影响范围

影响版本:

Apache ActiveMQ<5.18.3
Apache ActiveMQ<5.17.6

安全版本:

Apache ActiveMQ>=5.18.3
Apache ActiveMQ>=5.17.6

四、修复方案

目前官方已通过限制反序列化类只能为Throwable的子类的方式来修复此漏洞。建议受影响用户可以更新到:

Apache ActiveMQ >= 5.18.3

Apache ActiveMQ >= 5.17.6

Apache ActiveMQ >= 5.16.7

Apache ActiveMQ >= 5.15.16

https://github.com/apache/activemq/tags

Apache ActiveMQ (版本 < 5.18.3) (CNVD-2023-69477)RCE修复方案/缓解方案_第1张图片
5.18.3与5.17.6要求JDK11+

五、缓解方案

5.1增加访问验证

ActiveMQ 默认开放了 61616 端口,我们可以通过修改配置文件,使访问61616端口时需要进行登录验证。

在conf/activemq.xml文件中的的内加上:

<plugins> 		
			<simpleAuthenticationPlugin>    				
				<users>    					
					<authenticationUser username="system" password="123456" groups="users,admins"/>
					<authenticationUser username="user" password="123456"  groups="users"/>    
					<authenticationUser username="guest" password="123456" groups="guests"/>    
				users>    			
			simpleAuthenticationPlugin>    		
plugins>

对应访问ActiveMQ的代码也需要进行修改
共有三种操作(常规,集成spring,集成springboot):

常规:

ConnectionFactory cf = new ActiveMQConnectionFactory("system","123456","tcp://192.168.126.128:61616");

集成Spring:

<bean id="connectionFactory" class="org.apache.activemq.ActiveMQConnectionFactory">
    	<property name="brokerURL" value="tcp://192.168.126.128:61616"/>
    	<property name="userName" value="system"/>
    	<property name="password" value="123456"/>
    </bean>

集成SpringBoot:

spring.activemq.broker-url=tcp://192.168.126.128:61616
spring.activemq.user=system
spring.activemq.password=123456

5.2配置防火墙

通过配置firewall或者iptables 只给指定ip开放61616端口

你可能感兴趣的:(activemq,apache,漏洞修复)