CVE-2022-33140: Nifi registry core Code Injection Vulnerability
HIGHCVE-2022-33140 is a HIGH (CVSS 8.8) code injection vulnerability (CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')) affecting Nifi registry core libraries in the Maven ecosystem. The issue involves code injection in apache nifi and nifi registry. Remediation is available by upgrading affected packages to version 1.16.3.
CVE-2022-33140 at a Glance
Security Impact
CVSS: 8.8
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H).
How to Fix CVE-2022-33140
To remediate this vulnerability, upgrade all affected Nifi registry core 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.apache.nifi.registry</groupId>
<artifactId>nifi-registry-core</artifactId>
<version>1.16.3</version>
</dependency>
<dependency>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi</artifactId>
<version>1.16.3</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.apache.nifi.registry
How to Check if You Are Affected
To determine whether your Java application is affected by CVE-2022-33140, inspect your build dependencies using the Maven Dependency Plugin:
mvn dependency:tree -Dincludes=org.apache.nifi.registry
Analyze the terminal output to locate any version of Nifi registry core in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.16.3), your application is affected.
Note: The mvn dependency:tree -Dincludes=org.apache.nifi.registry 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-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection'), where the product constructs all or part of an os command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended os command when it is sent to a downstream component. In Nifi registry core, 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-2022-33140 Affected Nifi registry core Versions
2 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
org.apache.nifi.registry:nifi-registry-core
|
Maven |
≥ 0.6.0
< 1.16.3
|
1.16.3
|
|
org.apache.nifi:nifi
|
Maven |
≥ 1.10.0
< 1.16.3
|
1.16.3
|
References
Frequently Asked Questions
What is CVE-2022-33140?
Which Nifi registry core versions are affected?
What version fixes CVE-2022-33140?
Is nifi-registry-core affected?
Is nifi affected?
What is the CVSS score of CVE-2022-33140?
What CWE is associated with CVE-2022-33140?
How can I check Maven dependencies for CVE-2022-33140?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-77hf-23pq-2g7c",
"modified" : "2022-11-03T22:19:38Z",
"published" : "2022-06-16T00:00:26Z",
"aliases" : [ "CVE-2022-33140" ],
"summary" : "Code injection in Apache NiFi and NiFi Registry",
"details" : "The optional ShellUserGroupProvider in Apache NiFi 1.10.0 to 1.16.2 and Apache NiFi Registry 0.6.0 to 1.16.2 does not neutralize arguments for group resolution commands, allowing injection of operating system commands on Linux and macOS platforms. The ShellUserGroupProvider is not included in the default configuration. Command injection requires ShellUserGroupProvider to be one of the enabled User Group Providers in the Authorizers configuration. Command injection also requires an authenticated user with elevated privileges. Apache NiFi requires an authenticated user with authorization to modify access policies in order to execute the command. Apache NiFi Registry requires an authenticated user with authorization to read user groups in order to execute the command. The resolution removes command formatting based on user-provided arguments.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Maven",
"name" : "org.apache.nifi.registry:nifi-registry-core"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0.6.0"
}, {
"fixed" : "1.16.3"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Maven",
"name" : "org.apache.nifi:nifi"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "1.10.0"
}, {
"fixed" : "1.16.3"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-33140"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/apache/nifi"
}, {
"type" : "WEB",
"url" : "https://lists.apache.org/thread/bzs2pcdjsdrh5039oslmfr9mbs9qqdhr"
}, {
"type" : "WEB",
"url" : "https://nifi.apache.org/security.html#CVE-2022-33140"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-74", "CWE-78" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2022-06-17T21:49:10Z",
"nvd_published_at" : "2022-06-15T15:15:00Z"
}
}