CVE-2023-34468: Nifi dbcp base Apache NiFi Vulnerable To Code Vulnerability

HIGH
Advisory Identifier: GHSA-xm2m-2q6h-22jw
CVSS 8.8
CWE-94
Published
Advisory Summary

CVE-2023-34468 is a HIGH (CVSS 8.8) apache nifi vulnerable to code vulnerability (CWE-94: Improper Control of Generation of Code ('Code Injection')) affecting Nifi dbcp base libraries in the Maven ecosystem. The issue involves apache nifi vulnerable to code injection. Remediation is available by upgrading affected packages to version 1.22.0.

CVE-2023-34468 at a Glance

CVE Identifier CVE-2023-34468
GHSA Identifier GHSA-xm2m-2q6h-22jw
Severity HIGH
CVSS v3.1 Base Score 8.8
CWE Classification CWE-94: Improper Control of Generation of Code ('Code Injection')
Affected Product Nifi dbcp base
Package Ecosystem Maven
Published Date
Last Updated

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).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2023-34468

To remediate this vulnerability, upgrade all affected Nifi dbcp base dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

org.apache.nifi:nifi-dbcp-base fixed: 1.22.0
<dependency>
    <groupId>org.apache.nifi</groupId>
    <artifactId>nifi-dbcp-base</artifactId>
    <version>1.22.0</version>
</dependency>
org.apache.nifi:nifi-hikari-dbcp-service fixed: 1.22.0
<dependency>
    <groupId>org.apache.nifi</groupId>
    <artifactId>nifi-hikari-dbcp-service</artifactId>
    <version>1.22.0</version>
</dependency>
org.apache.nifi:nifi-dbcp-service-nar fixed: 1.22.0
<dependency>
    <groupId>org.apache.nifi</groupId>
    <artifactId>nifi-dbcp-service-nar</artifactId>
    <version>1.22.0</version>
</dependency>
Verify Direct and Transitive Dependencies

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

How to Check if You Are Affected

To determine whether your Java application is affected by CVE-2023-34468, inspect your build dependencies using the Maven Dependency Plugin:

mvn dependency:tree -Dincludes=org.apache.nifi

Analyze the terminal output to locate any version of Nifi dbcp base in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.22.0), your application is affected.

Note: The mvn dependency:tree -Dincludes=org.apache.nifi 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-94: Improper Control of Generation of Code ('Code Injection'), where the product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment. In Nifi dbcp base, 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

The DBCPConnectionPool and HikariCPConnectionPool Controller Services in Apache NiFi 0.0.2 through 1.21.0 allow an authenticated and authorized user to configure a Database URL with the H2 driver that enables custom code execution. The resolution validates the Database URL and rejects H2 JDBC locations. You are recommended to upgrade to version 1.22.0 or later which fixes this issue.

CVE-2023-34468 Affected Nifi dbcp base Versions

3 component(s)
Fixed Versions:
1.22.0
Product / Package Ecosystem Affected Versions Fixed Version
org.apache.nifi:nifi-dbcp-base
Maven
≥ 0.0.2
< 1.22.0
1.22.0
org.apache.nifi:nifi-hikari-dbcp-service
Maven
≥ 0.0.2
< 1.22.0
1.22.0
org.apache.nifi:nifi-dbcp-service-nar
Maven
≥ 0.0.2
< 1.22.0
1.22.0

References

Frequently Asked Questions

What is CVE-2023-34468?
CVE-2023-34468 is a security vulnerability in Nifi dbcp base involving Apache NiFi vulnerable to Code Injection under CWE-94: Improper Control of Generation of Code ('Code Injection').
Which Nifi dbcp base versions are affected?
Affected versions include releases prior to 1.22.0 across affected packages: org.apache.nifi:nifi-dbcp-base, org.apache.nifi:nifi-hikari-dbcp-service, org.apache.nifi:nifi-dbcp-service-nar.
What version fixes CVE-2023-34468?
Upgrading to 1.22.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is nifi-dbcp-base affected?
Yes, org.apache.nifi:nifi-dbcp-base is affected in releases prior to 1.22.0. Upgrade your dependency to 1.22.0 or later.
Is nifi-hikari-dbcp-service affected?
Yes, org.apache.nifi:nifi-hikari-dbcp-service is affected in releases prior to 1.22.0. Upgrade your dependency to 1.22.0 or later.
What is the CVSS score of CVE-2023-34468?
CVE-2023-34468 has a CVSS v3.1 base score of 8.8 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2023-34468?
CVE-2023-34468 is classified under CWE-94: Improper Control of Generation of Code ('Code Injection') (The product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment.).
How can I check Maven dependencies for CVE-2023-34468?
Run the dependency tree command: 'mvn dependency:tree -Dincludes=org.apache.nifi'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-xm2m-2q6h-22jw",
  "modified" : "2025-02-13T18:58:07Z",
  "published" : "2023-06-12T18:30:18Z",
  "aliases" : [ "CVE-2023-34468" ],
  "summary" : "Apache NiFi vulnerable to Code Injection",
  "details" : "The DBCPConnectionPool and HikariCPConnectionPool Controller Services in Apache NiFi 0.0.2 through 1.21.0 allow an authenticated and authorized user to configure a Database URL with the H2 driver that enables custom code execution.\n\nThe resolution validates the Database URL and rejects H2 JDBC locations.\n\nYou are recommended to upgrade to version 1.22.0 or later which fixes this issue.",
  "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:nifi-dbcp-base"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0.0.2"
      }, {
        "fixed" : "1.22.0"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.apache.nifi:nifi-hikari-dbcp-service"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0.0.2"
      }, {
        "fixed" : "1.22.0"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.apache.nifi:nifi-dbcp-service-nar"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0.0.2"
      }, {
        "fixed" : "1.22.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-34468"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/apache/nifi/pull/7349"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/apache/nifi/commit/4faf3ea59895e7e153db3f8f61147ff70a254361"
  }, {
    "type" : "WEB",
    "url" : "https://exceptionfactory.com/posts/2023/10/07/firsthand-analysis-of-apache-nifi-vulnerability-cve-2023-34468"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/apache/nifi"
  }, {
    "type" : "WEB",
    "url" : "https://issues.apache.org/jira/browse/NIFI-11653"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread/7b82l4f5blmpkfcynf3y6z4x1vqo59h8"
  }, {
    "type" : "WEB",
    "url" : "https://nifi.apache.org/security.html#CVE-2023-34468"
  }, {
    "type" : "WEB",
    "url" : "https://www.cyfirma.com/outofband/apache-nifi-cve-2023-34468-rce-vulnerability-analysis-and-exploitation"
  }, {
    "type" : "WEB",
    "url" : "http://packetstormsecurity.com/files/174398/Apache-NiFi-H2-Connection-String-Remote-Code-Execution.html"
  }, {
    "type" : "WEB",
    "url" : "http://www.openwall.com/lists/oss-security/2023/06/12/3"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-94" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-06-12T20:29:34Z",
    "nvd_published_at" : "2023-06-12T16:15:10Z"
  }
}