CVE-2023-40313: Opennms base assembly Remote Code Execution Vulnerability

HIGH
Advisory Identifier: GHSA-5m5f-qg8r-p9qf
CVSS 7.1
CWE-94
Published
Advisory Summary

CVE-2023-40313 is a HIGH (CVSS 7.1) remote code execution vulnerability (CWE-94: Improper Control of Generation of Code ('Code Injection')) affecting Opennms base assembly libraries in the Maven ecosystem. The issue involves opennms vulnerable to remote code execution. Remediation is available by upgrading affected packages to version 32.0.2.

CVE-2023-40313 at a Glance

CVE Identifier CVE-2023-40313
GHSA Identifier GHSA-5m5f-qg8r-p9qf
Severity HIGH
CVSS v3.1 Base Score 7.1
CWE Classification CWE-94: Improper Control of Generation of Code ('Code Injection')
Affected Product Opennms base assembly
Package Ecosystem Maven
Published Date
Last Updated

Security Impact

CVSS: 7.1

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:A/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:L).

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

How to Fix CVE-2023-40313

To remediate this vulnerability, upgrade all affected Opennms base assembly 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.opennms:opennms-base-assembly fixed: 32.0.2
<dependency>
    <groupId>org.opennms</groupId>
    <artifactId>opennms-base-assembly</artifactId>
    <version>32.0.2</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.opennms

How to Check if You Are Affected

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

mvn dependency:tree -Dincludes=org.opennms

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

Note: The mvn dependency:tree -Dincludes=org.opennms 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 Opennms base assembly, 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

A BeanShell interpreter in remote server mode runs in OpenNMS Horizon versions earlier than 32.0.2 and in related Meridian versions which could allow arbitrary remote Java code execution. The solution is to upgrade to Meridian 2023.1.6, 2022.1.19, 2021.1.30, 2020.1.38 or Horizon 32.0.2 or newer. Meridian and Horizon installation instructions state that they are intended for installation within an organization's private networks and should not be directly accessible from the Internet.

CVE-2023-40313 Affected Opennms base assembly Versions

1 component(s)
Fixed Versions:
32.0.2
Product / Package Ecosystem Affected Versions Fixed Version
org.opennms:opennms-base-assembly
Maven
< 32.0.2
32.0.2

References

Frequently Asked Questions

What is CVE-2023-40313?
CVE-2023-40313 is a security vulnerability in Opennms base assembly involving OpenNMS vulnerable to remote code execution under CWE-94: Improper Control of Generation of Code ('Code Injection').
Which Opennms base assembly versions are affected?
Affected versions include releases prior to 32.0.2 across affected packages: org.opennms:opennms-base-assembly.
What version fixes CVE-2023-40313?
Upgrading to 32.0.2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is opennms-base-assembly affected?
Yes, org.opennms:opennms-base-assembly is affected in releases prior to 32.0.2. Upgrade your dependency to 32.0.2 or later.
What is the CVSS score of CVE-2023-40313?
CVE-2023-40313 has a CVSS v3.1 base score of 7.1 (HIGH) with vector string CVSS:3.1/AV:A/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:L.
What CWE is associated with CVE-2023-40313?
CVE-2023-40313 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-40313?
Run the dependency tree command: 'mvn dependency:tree -Dincludes=org.opennms'. 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-5m5f-qg8r-p9qf",
  "modified" : "2023-08-18T21:51:39Z",
  "published" : "2023-08-17T21:30:53Z",
  "aliases" : [ "CVE-2023-40313" ],
  "summary" : "OpenNMS vulnerable to remote code execution",
  "details" : "A BeanShell interpreter in remote server mode runs in OpenNMS Horizon versions earlier than 32.0.2 and in related Meridian versions which could allow arbitrary remote Java code execution. The solution is to upgrade to Meridian 2023.1.6, 2022.1.19, 2021.1.30, 2020.1.38 or Horizon 32.0.2 or newer. Meridian and Horizon installation instructions state that they are intended for installation within an organization's private networks and should not be directly accessible from the Internet.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:A/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:L"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.opennms:opennms-base-assembly"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "32.0.2"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-40313"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/OpenNMS/opennms/pull/6368"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/OpenNMS/opennms/commit/2909448b039bd46241efa52c450ffdb4f5a7dee1"
  }, {
    "type" : "WEB",
    "url" : "https://docs.opennms.com/horizon/32/releasenotes/changelog.html"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/OpenNMS/opennms"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-94" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-08-18T21:51:39Z",
    "nvd_published_at" : "2023-08-17T19:15:13Z"
  }
}