CVE-2021-37941 APM Java Agent Local Privilege Escalation

High 7.8 Published Updated

A local attacker can attach a malicious file to an application using the APM Java Agent to execute commands with elevated privileges.

Exploited in the wild
Not known
Login needed
Any signed-in user
Attackable
Local or same network only
Victim action needed
Not needed
Fix
Available

What is CVE-2021-37941?

CVE-2021-37941 is a high-severity vulnerability in Elastic APM Java Agent, published on 8 Dec 2021. It can only be exploited from the same machine or local network, with no action from the victim.

Official description

A local privilege escalation issue was found with the APM Java agent, where a user on the system could attach a malicious file to an application running with the APM Java agent. Using this vector, a malicious or compromised user account could use the agent to run commands at a higher level of permissions than they possess. This vulnerability affects users that have set up the agent via the attacher cli 3, the attach API 2, as well as users that have enabled the profiling_inferred_spans_enabled option

Weakness: CWE-269

Which versions are affected by CVE-2021-37941?

3 open source packages ship an affected version, including elastic-apm. It affects 1 product.

PackageAffectedFixed in
elastic-apm PyPIFrom 1.10.01.27.0
elastic-apm PyPIFrom 1.10.01.27.0
elastic-apm PyPIFrom 1.10.01.27.0

Products include Elastic Apm Agent.

How do I fix CVE-2021-37941?

Upgrade elastic-apm to 1.27.0 or later.

Is CVE-2021-37941 being exploited?

There is no known exploitation of CVE-2021-37941 in the wild and no public exploit code.

Sources

Also known as GHSA-r562-m862-63w3, PYSEC-2026-634.

Is CVE-2021-37941 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free