Skip to content

enable fastjson safeMode for rocketmq broker/nameserver/controller/exporter - #34

Merged
drivebyer merged 3 commits into
mainfrom
add-fastjson-safemode
Aug 4, 2026
Merged

drivebyer merged 3 commits into
mainfrom
add-fastjson-safemode

Conversation

@drivebyer

@drivebyer drivebyer commented Aug 3, 2026 •

Copy link
Copy Markdown
Contributor

Background

fastjson 1.2.68~1.2.83 has a deserialization RCE (Sangfor advisory 2026-07-21, no CVE assigned, no upstream 1.x fix). RocketMQ 5.x ships fastjson 1.2.83 in its official binary release; the exporter build pulls in fastjson 1.2.69_noneautotype. RocketMQ does not use autoType so real-world exploitability is low, but scanners flag it. Enabling safeMode (-Dfastjson.parser.safeMode=true, supported since 1.2.68) fully disables autoType and is the recommended mitigation.

Changes

  • rocketmq-broker / rocketmq-nameserver / rocketmq-controller: add JAVA_OPT="${JAVA_OPT} -Dfastjson.parser.safeMode=true" in the customize startup scripts, placed before the ${JAVA_OPT_EXT} line so users can still override it via the documented JAVA_OPT_EXT env.
  • rocketmq-exporter: add -Dfastjson.parser.safeMode=true to the exec-form ENTRYPOINT (before -jar; exec form has no shell so an ENV-based approach would not work).
  • rocketmq-exporter: fix the -Dmaven.test.skip=truedocker typo → -Dmaven.test.skip=true (tests were silently not being skipped).
  • base image swap (unblocks CI): openjdk:8-alpine has been removed from Docker Hub, so broker/nameserver/controller builds fail on main as well. Switched to bellsoft/liberica-openjdk-alpine-musl:8 (JDK 8u502, Docker verified publisher, linux/amd64 + linux/arm64, keeps the apk build flow and standard JDK8 layout incl. jre/lib/ext).
  • exporter: bump tomcat-embed-core 9.0.74 → 9.0.118 via -Dtomcat.version build override: trivy gates on 3 CRITICALs (CVE-2026-41293 / CVE-2026-43512 / CVE-2026-43515) fixed in 9.0.118 (same 9.0.x line as managed by spring-boot-starter-parent 2.7.11).

Release plan

After merge, new tags will be published via build-push-images.yml: broker/nameserver/controller v5.3.3-3 + v5.1.4-3, exporter v0.1.2.

…porter

- inject -Dfastjson.parser.safeMode=true into broker/nameserver/controller
  startup scripts, before the JAVA_OPT_EXT line so users can still override
- add -Dfastjson.parser.safeMode=true to exporter ENTRYPOINT (before -jar)
- fix -Dmaven.test.skip=truedocker typo in exporter Dockerfile

Mitigates fastjson 1.2.68~1.2.83 deserialization RCE (no upstream 1.x fix).
…usl:8

openjdk:8-alpine has been removed from Docker Hub (manifest unknown),
breaking all broker/nameserver/controller builds. Liberica alpine-musl 8
(JDK 8u502) is a Docker verified publisher image with linux/amd64 +
linux/arm64 support, keeps the apk-based build flow unchanged, and ships
JAVA_HOME preconfigured.
trivy flags 3 CRITICALs (CVE-2026-41293, CVE-2026-43512, CVE-2026-43515)
in tomcat-embed-core 9.0.74 pulled in via spring-boot-starter-parent
2.7.11. Override tomcat.version at build time; 9.0.118 is the fixed
release on the same 9.0.x line.
@drivebyer
drivebyer merged commit ad1f2b1 into main Aug 4, 2026
15 checks passed
@drivebyer
drivebyer deleted the add-fastjson-safemode branch August 4, 2026 02:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant