CVE-2021-40143: Nexus repository HTTP Header Injection Vulnerability
HIGHCVE-2021-40143 is a HIGH (CVSS 8.2) http header injection vulnerability (CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection')) affecting Nexus repository libraries in the Maven ecosystem. The issue involves http header injection in sonatype nexus repository. Remediation is available by upgrading affected packages to version 3.34.0-01.
CVE-2021-40143 at a Glance
Security Impact
CVSS: 8.2
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:N).
How to Fix CVE-2021-40143
To remediate this vulnerability, upgrade all affected Nexus repository 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>org.sonatype.nexus</groupId>
<artifactId>nexus-repository</artifactId>
<version>3.34.0-01</version>
</dependency>
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
mvn dependency:tree -Dincludes=org.sonatype.nexus
How to Check if You Are Affected
To determine whether your Java application is affected by CVE-2021-40143, inspect your build dependencies using the Maven Dependency Plugin:
mvn dependency:tree -Dincludes=org.sonatype.nexus
Analyze the terminal output to locate any version of Nexus repository in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.34.0-01), your application is affected.
Note: The mvn dependency:tree -Dincludes=org.sonatype.nexus 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-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection'), where the product constructs all or part of a command, data structure, or record using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify how it is parsed or interpreted when it is sent to a downstream component. In Nexus repository, 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-40143 Affected Nexus repository Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
org.sonatype.nexus:nexus-repository
|
Maven |
≥ 3.0.0
< 3.34.0-01
|
3.34.0-01
|
References
Frequently Asked Questions
What is CVE-2021-40143?
Which Nexus repository versions are affected?
What version fixes CVE-2021-40143?
Is nexus-repository affected?
What is the CVSS score of CVE-2021-40143?
What CWE is associated with CVE-2021-40143?
How can I check Maven dependencies for CVE-2021-40143?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-f34x-8pf6-qc9c",
"modified" : "2021-09-15T18:27:54Z",
"published" : "2021-09-08T17:42:18Z",
"aliases" : [ "CVE-2021-40143" ],
"summary" : "HTTP header injection in Sonatype Nexus Repository",
"details" : "Sonatype Nexus Repository 3.x through 3.33.1-01 is vulnerable to an HTTP header injection. By sending a crafted HTTP request, a remote attacker may disclose sensitive information or request external resources from a vulnerable instance.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Maven",
"name" : "org.sonatype.nexus:nexus-repository"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "3.0.0"
}, {
"fixed" : "3.34.0-01"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 3.33.1-01"
}
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-40143"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/sonatype/nexus-public"
}, {
"type" : "WEB",
"url" : "https://help.sonatype.com/repomanager3/release-notes/2021-release-notes"
}, {
"type" : "WEB",
"url" : "https://issues.sonatype.org/secure/ReleaseNote.jspa"
}, {
"type" : "WEB",
"url" : "https://support.sonatype.com/hc/en-us/articles/4405941762579"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-74" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2021-09-08T17:35:50Z",
"nvd_published_at" : "2021-09-07T20:15:00Z"
}
}