Apm AgentApplication · Elastic

CVE-2021-37941

HIGH · 7.8 CVSS v3.1 Published 2021-12-08
Fix available
A fix is available. Upgrade to after 1.26.0 or later.
See remediation →
80/100
Remediation priority · High
Zero-click

Official description Straight from the sourceThe vendor's or NVD's own wording, published unedited. Authoritative, but often terse — it says what broke, rarely what to do.

NVD · unedited
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

Technical summary Written by usOur analysis, written from the advisory, the CVSS vector and the affected-version data. It adds context the advisory leaves out, and never invents facts that are not in the source.

dbcve analysis · high confidence

A local privilege escalation vulnerability exists in the APM Java agent where a user on the system can attach a malicious file to an application running with the agent. This affects deployments using the attacher CLI, attach API, or the profiling_inferred_spans_enabled option, allowing malicious or compromised users to execute commands at elevated privilege levels.

MitigationOrganizations should review whether the attacher CLI, attach API, or profiling_inferred_spans_enabled configuration are necessary for their deployment. If not required, disable these features. If required, ensure only trusted users have access to the systems running the APM agent and consider applying any available agent updates that address this vulnerability.

Verify against the referenced sources before acting — the references below are authoritative for this CVE, this summary is not.

Affected products & versions What the vendor confirmedThe version ranges the vendor confirmed as vulnerable. If your version sits inside a range here, treat yourself as exposed until you have upgraded.

NVD · CPE data
Apm AgentApplication
Affected:>= 1.10.0, <= 1.26.0

CVSS breakdown How the score is builtThe industry scoring standard. It rates how the flaw is reached, what it takes to exploit, and what an attacker gains — the score is derived from those, not the other way round.

From the vector
Attack vector
Local
Complexity
Low
Privileges
Low
User interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

Am I affected? How to checkSteps we derive from the advisory and the affected-version data, so you can decide whether this CVE reaches your setup. They are a guide, not a scan — your own configuration is the authority.

dbcve checks

Work through these to decide whether this CVE applies to you.

  1. Identify if Elastic APM Java agent is installed
    Search for apm-agent-*.jar files in application directories, Java classpath, or container images. Check application startup scripts for -javaagent JVM arguments referencing elastic-apm-agent.
    Affected if Elastic APM Java agent is present in the environment
  2. Verify the installed agent version
    Inspect the filename of the apm-agent jar file (e.g., elastic-apm-agent-1.20.0.jar) or run: jar -xf apm-agent-*.jar META-INF/MANIFEST.MF && grep Implementation-Version META-INF/MANIFEST.MF
    Affected if The version is greater than or equal to 1.10.0 and less than or equal to 1.26.0
  3. Check if the attacher CLI is in use
    Search process listings or startup scripts for commands invoking the attacher, such as 'java -jar apm-agent-attach*.jar' or programmatic calls to the ApmAgent.attach() API.
    Affected if The attacher CLI is used to attach the agent to running JVM processes
  4. Check if the attach API is used programmatically
    Review application source code for imports of 'co.elastic.apm.attach' packages and calls to ApmAgentAttacher.get().attach() or similar attachment methods.
    Affected if The application code uses the attach API to dynamically attach the agent
  5. Check if profiling_inferred_spans_enabled is configured
    Search configuration files (apm.properties, YAML config) or environment variables for the setting 'profiling_inferred_spans_enabled=true' or check if the agent is configured with inferred_spans profiling enabled.
    Affected if profiling_inferred_spans_enabled is set to true in agent configuration

The environment is affected if the Elastic APM Java agent version is between 1.10.0 and 1.26.0 AND any of the following is true: the attacher CLI is used, the attach API is used, or profiling_inferred_spans_enabled is enabled.

Generated from the published advisory. Verify against your own configuration.

Check your environment

Paste your version and any relevant configuration and it will be compared against the affected criteria above. Do not include secrets or credentials.

AI-assisted, checked against the advisory. Informational, not a guarantee.

Remediation Closing itWhat it takes to close this. Where a vendor fix exists we point at it; where none exists we say so plainly, and can build one. Effort estimates are scoped from the advisory, not from your codebase.

dbcve · scoped
Upgrade available Upgrade to a release after 1.26.0
Interim mitigation

Organizations should review whether the attacher CLI, attach API, or profiling_inferred_spans_enabled configuration are necessary for their deployment. If not required, disable these features. If required, ensure only trusted users have access to the systems running the APM agent and consider applying any available agent updates that address this vulnerability.

Recommended fix High confidence

Elastic APM Java agent version 1.27.0 or later

  1. 1. Identify all systems running the Elastic APM Java agent versions 1.10.0 through 1.26.0
  2. 2. Download the fixed APM Java agent version (1.27.0 or later) from the official Elastic repository
  3. 3. Replace the vulnerable agent JAR file on all affected systems
  4. 4. Restart the monitored Java applications to load the updated agent
  5. 5. Verify the agent version after restart to confirm the upgrade was successful

Generated from the published advisory — verify against the referenced sources before acting.

Fix this in Apm Agent Scoped from the published advisory
  • Consultation3.0 h
  • Implementation6.0 h
  • Testing3.0 h
  • Review / QA2.0 h
14.0 hours of engineering $2,490
Get the upgrade done

An estimate, not a bill — we confirm scope with you before any work starts. Need it this week? Rush from $3,984.

Scan for this in your stack

Free · runs locally
dbcve dependency scanner

Check whether your project pulls in CVE-2021-37941 — or any other known-vulnerable package — straight from your lock files. Free and open source; it runs locally and uploads nothing.

References Go to the primary sourcePrimary sources — vendor advisories, patches and trackers. Where our summary and a reference disagree, the reference wins.

Primary sources

Practitioner notes

Contributed

Peer-ranked notes from engineers who’ve handled CVE-2021-37941 in production — separate from our analysis above.

No notes yet

Be the first to add a field note for this CVE — a mitigation you’ve verified, a version caveat, or a link to a working fix. Sign in above to contribute.

What this is

A place for practitioners to share what actually worked: a mitigation you’ve tested, a configuration change, a version- or environment-specific caveat, or a link to a verified patch. The most useful notes rise to the top as peers upvote them, so the signal stays high.

What belongs here
  • Verified mitigations, workarounds, and config changes
  • Version or environment caveats, and links to real fixes
  • No weaponised exploit code, or anything meant to cause harm
  • No spam, self-promotion, credentials, or personal data