Skip to content

Commit 3aad50b

Browse files
authored
[Security] Bump ActiveMQ from 5.14.5 to 5.19.2 (#37944)
Fixes CVE-2023-46604 (CVSS 10.0, RCE via OpenWire protocol) and CVE-2022-41678 (CVSS 8.8, RCE via Jolokia and REST API). ActiveMQ is used exclusively as a test dependency in Beam (embedded broker for JMS, MQTT, and AMQP IO connector tests). Changes required for compatibility: - Upgrade JMS spec from 1.1 to 2.0 (geronimo-jms) for JMS IO, since ActiveMQ 5.19.x uses JMS 2.0 API (setJMSDeliveryTime). - Add JMS 2.0 createContext() stubs to MockNonSerializableConnectionFactory. - Exclude transitive proton-j from activemq-amqp in AMQP IO to avoid conflict with the directly declared proton-j:0.16.0. All three affected test modules pass: JMS IO, MQTT IO, AMQP IO. Fixes #37943
1 parent 7187ff6 commit 3aad50b

5 files changed

Lines changed: 31 additions & 4 deletions

File tree

CHANGES.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,10 @@
8585

8686
* Fixed X (Java/Python) ([#X](https://github.com/apache/beam/issues/X)).
8787

88+
## Security Fixes
89+
90+
* Fixed [CVE-2023-46604](https://www.cve.org/CVERecord?id=CVE-2023-46604) (CVSS 10.0) and [CVE-2022-41678](https://www.cve.org/CVERecord?id=CVE-2022-41678) by upgrading ActiveMQ from 5.14.5 to 5.19.2 (Java) ([#37943](https://github.com/apache/beam/issues/37943)).
91+
8892
## Known Issues
8993

9094
[comment]: # ( When updating known issues after release, make sure also update website blog in website/www/site/content/blog.)
@@ -2382,4 +2386,4 @@ Schema Options, it will be removed in version `2.23.0`. ([BEAM-9704](https://iss
23822386

23832387
## Highlights
23842388

2385-
- For versions 2.19.0 and older release notes are available on [Apache Beam Blog](https://beam.apache.org/blog/).
2389+
- For versions 2.19.0 and older release notes are available on [Apache Beam Blog](https://beam.apache.org/blog/).

buildSrc/src/main/groovy/org/apache/beam/gradle/BeamModulePlugin.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -597,7 +597,7 @@ class BeamModulePlugin implements Plugin<Project> {
597597
//
598598
// There are a few versions are determined by the BOMs by running scripts/tools/bomupgrader.py
599599
// marked as [bomupgrader]. See the documentation of that script for detail.
600-
def activemq_version = "5.14.5"
600+
def activemq_version = "5.19.2"
601601
def autovalue_version = "1.9"
602602
def autoservice_version = "1.0.1"
603603
def aws_java_sdk2_version = "2.20.162"

sdks/java/io/amqp/build.gradle

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ dependencies {
3030
testImplementation library.java.slf4j_api
3131
testImplementation library.java.junit
3232
testImplementation library.java.activemq_broker
33-
testImplementation library.java.activemq_amqp
33+
testImplementation(library.java.activemq_amqp) {
34+
exclude group: 'org.apache.qpid', module: 'proton-j'
35+
}
3436
testImplementation library.java.activemq_junit
3537
testImplementation library.java.hamcrest
3638
testRuntimeOnly library.java.slf4j_jdk14

sdks/java/io/jms/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ dependencies {
3232
implementation project(path: ":sdks:java:core", configuration: "shadow")
3333
implementation library.java.slf4j_api
3434
implementation library.java.joda_time
35-
implementation "org.apache.geronimo.specs:geronimo-jms_1.1_spec:1.1.1"
35+
implementation "org.apache.geronimo.specs:geronimo-jms_2.0_spec:1.0-alpha-2"
3636
testImplementation library.java.activemq_amqp
3737
testImplementation library.java.activemq_broker
3838
testImplementation library.java.activemq_jaas

sdks/java/io/jms/src/test/java/org/apache/beam/sdk/io/jms/MockNonSerializableConnectionFactory.java

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
import javax.jms.Connection;
2121
import javax.jms.ConnectionFactory;
22+
import javax.jms.JMSContext;
2223
import javax.jms.JMSException;
2324

2425
public class MockNonSerializableConnectionFactory implements ConnectionFactory {
@@ -31,4 +32,24 @@ public Connection createConnection() throws JMSException {
3132
public Connection createConnection(String userName, String password) throws JMSException {
3233
return null;
3334
}
35+
36+
@Override
37+
public JMSContext createContext() {
38+
throw new UnsupportedOperationException();
39+
}
40+
41+
@Override
42+
public JMSContext createContext(String userName, String password) {
43+
throw new UnsupportedOperationException();
44+
}
45+
46+
@Override
47+
public JMSContext createContext(String userName, String password, int sessionMode) {
48+
throw new UnsupportedOperationException();
49+
}
50+
51+
@Override
52+
public JMSContext createContext(int sessionMode) {
53+
throw new UnsupportedOperationException();
54+
}
3455
}

0 commit comments

Comments
 (0)