p PatchFirst

CVE-2022-41678

CVE-2022-41678 · Apache ActiveMQ: Insufficient API restrictions on Jolokia allow authenticated users to perform RCE

CVSS 8.8 · High · EPSS 86.7% · Public exploit · Fix available

Compare with your installed version

Affected products and known fixed versions are public information. Compare them with your installed version.

  • apache activemqUpdate to 5.16.6 / 5.17.4
  • activemq Debian 12Update to 5.17.2+dfsg-2+deb12u1
  • activemq Debian 13Update to 5.17.6+dfsg-1
  • activemq Ubuntu Pro 16.04 LTSUpdate to 5.13.2+dfsg-2ubuntu0.1~esm1
  • and 3 more

Check the installed version:

dpkg-query -W -f='${source:Package} ${binary:Package} ${Version}\n' | awk '$1=="activemq"'

Assess your server’s risks

The free check gives you a rating and a risk summary by technology stack, without signing up. It does not answer whether this particular vulnerability affects you.

Monitoring matches public information against your servers’ software. Detailed findings for your servers include the order of updates.

curl -fsSL https://patchfirst.dev/check.sh | sh
Check your server for free →

Channels carry general technology news; monitoring reports new findings on your servers in your dashboard, through browser notifications, in Telegram or via a webhook.

This page contains facts from public vulnerability sources. Check the original advisory before updating.

Once an user is authenticated on Jolokia, he can potentially trigger arbitrary code execution.

In details, in ActiveMQ configurations, jetty allows org.jolokia.http.AgentServlet to handler request to /api/jolokia

org.jolokia.http.HttpRequestHandler#handlePostRequest is able to create JmxRequest through JSONObject. And calls to org.jolokia.http.HttpRequestHandler#executeRequest.

Into deeper calling stacks, org.jolokia.handler.ExecHandler#doHandleRequest can be invoked through refection. This could lead to RCE through via various mbeans. One example is unrestricted deserialization in jdk.management.jfr.FlightRecorderMXBeanImpl which exists on Java version above 11.

1 Call newRecording.

2 Call setConfiguration. And a webshell data hides in it.

3 Call startRecording.

4 Call copyTo method. The webshell will be written to a .jsp file.

The mitigation is to restrict (by default) the actions authorized on Jolokia, or disable Jolokia. A more restrictive Jolokia configuration has been defined in default ActiveMQ distribution. We encourage users to upgrade to ActiveMQ distributions version including updated Jolokia configuration: 5.16.6, 5.17.4, 5.18.0, 6.0.0.

Published
Updated

Fixes in distributions

  • USN-7268-1 · Ubuntu 22.04 LTS ·
  • DSA-5798-1 · Debian 12 ·
  • DLA-3936-1 · Debian 11 ·
  • USN-6910-1 · Ubuntu Pro 16.04 LTS, Ubuntu Pro 18.04 LTS, Ubuntu Pro 20.04 LTS, Ubuntu Pro 22.04 LTS ·

Stack: system

Affected products and versions

  • apache activemq

    Versions
    • ≥ 0, < 5.16.6: Affected (semver)
    • ≥ 5.17.0, < 5.17.4: Affected (semver)
    • 5.18.0: Not affected
    • 6.0.0: Not affected

    Update to 5.16.6; Update to 5.17.4

  • activemq Debian 12

    Versions
    • 5.17.2+dfsg-2
    Affected ranges
    • ECOSYSTEM: < 5.17.2+dfsg-2+deb12u1

    Update to 5.17.2+dfsg-2+deb12u1

  • activemq Debian 13

    Affected ranges
    • ECOSYSTEM: < 5.17.6+dfsg-1

    Update to 5.17.6+dfsg-1

  • activemq Ubuntu Pro 16.04 LTS

    Versions
    • 5.6.0+dfsg1-4+deb8u1ubuntu1
    • 5.6.0+dfsg1-5
    • 5.13.2+dfsg-2
    Affected ranges
    • ECOSYSTEM: < 5.13.2+dfsg-2ubuntu0.1~esm1

    Update to 5.13.2+dfsg-2ubuntu0.1~esm1

  • activemq Ubuntu Pro 18.04 LTS

    Versions
    • 5.14.5-3
    • 5.15.2-2
    • 5.15.3-2
    • 5.15.8-2~18.04
    Affected ranges
    • ECOSYSTEM: < 5.15.8-2~18.04.1~esm1

    Update to 5.15.8-2~18.04.1~esm1

  • activemq Ubuntu Pro 20.04 LTS

    Versions
    • 5.15.10-1
    • 5.15.11-1
    Affected ranges
    • ECOSYSTEM: < 5.15.11-1ubuntu0.1~esm1

    Update to 5.15.11-1ubuntu0.1~esm1

  • activemq Ubuntu 22.04 LTS

    Versions
    • 5.16.1-1
    Affected ranges
    • ECOSYSTEM: < 5.16.1-1ubuntu0.1

    Update to 5.16.1-1ubuntu0.1

Original sources

Check your server →