Vulnerabilities in pkg:maven/co.elastic.apm/elastic-apm-agent
PACKAGECVE-2021-37942 is a HIGH (CVSS 7.0) apm java agent local privilege vulnerability (CWE-269: Improper Privilege Management) affecting Apm agent parent libraries in the Maven ecosystem. The issue involves apm java agent local privilege escalation issue. Remediation is available by upgrading affected packages to version 1.27.1.
pkg:maven/co.elastic.apm/elastic-apm-agent
Vulnerability advisories affecting package pkg:maven/co.elastic.apm/elastic-apm-agent. Select an advisory below to view technical details or fixes.
| Advisory ID | CVE / NVD | Severity | Summary |
|---|---|---|---|
| GHSA-5xqm-hc45-f2g2 | CVE-2021-37942 | HIGH | APM Java Agent Local Privilege Escalation issue |
CVE-2021-37942 at a Glance
Security Impact
CVSS: 7.0
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H).
How to Fix CVE-2021-37942
To remediate this vulnerability, upgrade all affected Apm agent parent dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
<dependency>
<groupId>co.elastic.apm</groupId>
<artifactId>apm-agent-parent</artifactId>
<version>1.27.1</version>
</dependency>
<dependency>
<groupId>co.elastic.apm</groupId>
<artifactId>elastic-apm-agent</artifactId>
<version>1.27.1</version>
</dependency>
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
mvn dependency:tree -Dincludes=co.elastic.apm
How to Check if You Are Affected
To determine whether your Java application is affected by CVE-2021-37942, inspect your build dependencies using the Maven Dependency Plugin:
mvn dependency:tree -Dincludes=co.elastic.apm
Analyze the terminal output to locate any version of Apm agent parent in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.27.1), your application is affected.
Note: The mvn dependency:tree -Dincludes=co.elastic.apm command inspects the resolved dependency graph declared in your project's POM files; it does not perform automated security scanning or inspect runtime dynamic classpaths. Always verify runtime container classpaths and shaded JARs.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-269: Improper Privilege Management, where the product does not properly assign, modify, track, or check privileges for an actor, creating an unintended sphere of control for that actor. In Apm agent parent, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2021-37942 Affected Apm agent parent Versions
2 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
co.elastic.apm:apm-agent-parent
|
Maven |
≥ 1.18.0
< 1.27.1
|
1.27.1
|
|
co.elastic.apm:elastic-apm-agent
|
Maven |
≥ 1.18.0
< 1.27.1
|
1.27.1
|
References
Frequently Asked Questions
What is CVE-2021-37942?
Which Apm agent parent versions are affected?
What version fixes CVE-2021-37942?
Is apm-agent-parent affected?
Is elastic-apm-agent affected?
What is the CVSS score of CVE-2021-37942?
What CWE is associated with CVE-2021-37942?
How can I check Maven dependencies for CVE-2021-37942?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-5xqm-hc45-f2g2",
"modified" : "2025-09-30T16:35:24Z",
"published" : "2023-11-22T03:30:19Z",
"aliases" : [ "CVE-2021-37942" ],
"summary" : "APM Java Agent Local Privilege Escalation issue",
"details" : "A local privilege escalation issue was found with the APM Java agent, where a user on the system could attach a malicious plugin to an application running the APM Java agent. By using this vulnerability, an attacker could execute code at a potentially higher level of permissions than their user typically has access to.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Maven",
"name" : "co.elastic.apm:apm-agent-parent"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "1.18.0"
}, {
"fixed" : "1.27.1"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Maven",
"name" : "co.elastic.apm:elastic-apm-agent"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "1.18.0"
}, {
"fixed" : "1.27.1"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-37942"
}, {
"type" : "WEB",
"url" : "https://discuss.elastic.co/t/apm-java-agent-security-update/291355"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/elastic/apm-agent-java"
}, {
"type" : "WEB",
"url" : "https://www.elastic.co/community/security"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-269" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2023-11-22T20:57:05Z",
"nvd_published_at" : "2023-11-22T02:15:42Z"
}
}