CVE-2022-25897: Sdk server Remote Code Execution Vulnerability

HIGH
Advisory Identifier: GHSA-fph9-f5r6-vhqf
CVSS 7.5
CWE-770
Published
Advisory Summary

CVE-2022-25897 is a HIGH (CVSS 7.5) remote code execution vulnerability (CWE-770: Allocation of Resources Without Limits or Throttling) affecting Sdk server libraries in the Maven ecosystem. The issue involves eclipse milo vulnerable to resource exhaustion (denial of service). Remediation is available by upgrading affected packages to version 0.6.8.

CVE-2022-25897 at a Glance

CVE Identifier CVE-2022-25897
GHSA Identifier GHSA-fph9-f5r6-vhqf
Severity HIGH
CVSS v3.1 Base Score 7.5
CWE Classification CWE-770: Allocation of Resources Without Limits or Throttling
Affected Product Sdk server
Package Ecosystem Maven
Published Date
Last Updated

Security Impact

CVSS: 7.5

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:N/I:N/A:H).

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

How to Fix CVE-2022-25897

To remediate this vulnerability, upgrade all affected Sdk server 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.eclipse.milo:sdk-server fixed: 0.6.8
<dependency>
    <groupId>org.eclipse.milo</groupId>
    <artifactId>sdk-server</artifactId>
    <version>0.6.8</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.eclipse.milo

How to Check if You Are Affected

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

mvn dependency:tree -Dincludes=org.eclipse.milo

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

Note: The mvn dependency:tree -Dincludes=org.eclipse.milo 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-770: Allocation of Resources Without Limits or Throttling, where the product allocates a reusable resource or group of resources on behalf of an actor without imposing any intended restrictions on the size or number of resources that can be allocated. In Sdk server, 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

### Impact Denial of Service ### Details OPC UA specification describes a concept named _Subscriptions_. _Subscriptions_ monitor a set of _Monitored Items_ for _Notifications_ and return them to the _Client_ in response to _Publish_ requests. The server notifies the client about changes only in case the value is changed. Each monitored item is configured on a subscription, each subscription is linked to a single OPC UA session. Most OPC UA implementations set many controls and limitations for excessive memory consumption. For example: * What is the maximum allowed number of concurrent sessions * For each active sessions - what is the maximum allowed number of concurrent subscription per a single session * For each active subscription - what is the maximum allowed number of concurrent monitored items per a single subscription Clarity Research discovered a unique way to bypass those restrictions and fill up the OPC UA server process memory. The close session request closes a connected session. A `deleteSubscription` flag is also sent in that message and determines whether the server should save the subscriptions for a future session reconnection or discard them upon session termination. If the `deleteSubscription` flag is `False` the server will store the subscriptions thus filling up the memory in an unlimited manner. Sending multiple subscribe requests with multiple monitored items from multiple sessions will quickly fill up the process memory until the server crashes. To trigger this bug all is needed is to create many sessions with subscriptions and monitored items without ever deleting the monitored items. Eventually these allocations will consume all the available process memory which will lead to a crash and denial of service condition. Clarity PoC does: ``` while True: Open a valid OPC UA session Create multiple subscriptions Add monitored items to each subscription Close the session with the DeleteSubscriptions flag = False ```` ### Acknowledgement We would like to thanks Vera Mens, Uri Katz, @sharonbrizinov of Team82 ([Claroty Research](https://claroty.com/)) for this report. ### For more information If you have any questions or comments about this advisory: * Open an issue in [Eclipse Milo repository](https://github.com/eclipse/milo/issues) * Email us at [milo-dev](https://accounts.eclipse.org/mailing-list/milo-dev)

CVE-2022-25897 Affected Sdk server Versions

1 component(s)
Fixed Versions:
0.6.8
Product / Package Ecosystem Affected Versions Fixed Version
org.eclipse.milo:sdk-server
Maven
< 0.6.8
0.6.8

References

Frequently Asked Questions

What is CVE-2022-25897?
CVE-2022-25897 is a security vulnerability in Sdk server involving Eclipse Milo vulnerable to Resource Exhaustion (Denial of Service) under CWE-770: Allocation of Resources Without Limits or Throttling.
Which Sdk server versions are affected?
Affected versions include releases prior to 0.6.8 across affected packages: org.eclipse.milo:sdk-server.
What version fixes CVE-2022-25897?
Upgrading to 0.6.8 (or the latest patched release for your respective branch) resolves the vulnerability.
Is sdk-server affected?
Yes, org.eclipse.milo:sdk-server is affected in releases prior to 0.6.8. Upgrade your dependency to 0.6.8 or later.
What is the CVSS score of CVE-2022-25897?
CVE-2022-25897 has a CVSS v3.1 base score of 7.5 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H.
What CWE is associated with CVE-2022-25897?
CVE-2022-25897 is classified under CWE-770: Allocation of Resources Without Limits or Throttling (The product allocates a reusable resource or group of resources on behalf of an actor without imposing any intended restrictions on the size or number of resources that can be allocated.).
How can I check Maven dependencies for CVE-2022-25897?
Run the dependency tree command: 'mvn dependency:tree -Dincludes=org.eclipse.milo'. 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-fph9-f5r6-vhqf",
  "modified" : "2022-09-15T03:35:46Z",
  "published" : "2022-09-15T03:35:46Z",
  "aliases" : [ "CVE-2022-25897" ],
  "summary" : "Eclipse Milo vulnerable to Resource Exhaustion (Denial of Service)",
  "details" : "### Impact\n\nDenial of Service\n\n### Details\n\nOPC UA specification describes a concept named _Subscriptions_. _Subscriptions_ monitor a set of _Monitored Items_ for _Notifications_ and return them to the _Client_ in response to _Publish_ requests. The server notifies the client about changes only in case the value is changed. Each monitored item is configured on a subscription, each subscription is linked to a single OPC UA session. Most OPC UA implementations set many controls and limitations for excessive memory consumption. For example:\n\n* What is the maximum allowed number of concurrent sessions\n* For each active sessions - what is the maximum allowed number of concurrent subscription per a single session\n* For each active subscription - what is the maximum allowed number of concurrent monitored items per a single subscription\n\nClarity Research discovered a unique way to bypass those restrictions and fill up the OPC UA server process memory.\n\nThe close session request closes a connected session. A `deleteSubscription` flag is also sent in that message and determines whether the server should save the subscriptions for a future session reconnection or discard them upon session termination. If the `deleteSubscription` flag is `False` the server will store the subscriptions thus filling up the memory in an unlimited manner.\n\nSending multiple subscribe requests with multiple monitored items from multiple sessions will quickly fill up the process memory until the server crashes.\n\nTo trigger this bug all is needed is to create many sessions with subscriptions and monitored items without ever deleting the monitored items. Eventually these allocations will consume all the available process memory which will lead to a crash and denial of service condition.\n\nClarity PoC does:\n```\nwhile True:\n    Open a valid OPC UA session\n    Create multiple subscriptions\n    Add monitored items to each subscription\n    Close the session with the DeleteSubscriptions flag = False\n````\n\n### Acknowledgement\n\nWe would like to thanks Vera Mens, Uri Katz, @sharonbrizinov of Team82 ([Claroty Research](https://claroty.com/)) for this report.\n\n### For more information\nIf you have any questions or comments about this advisory:\n* Open an issue in [Eclipse Milo repository](https://github.com/eclipse/milo/issues)\n* Email us at [milo-dev](https://accounts.eclipse.org/mailing-list/milo-dev)\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.eclipse.milo:sdk-server"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.6.8"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/eclipse/milo/security/advisories/GHSA-fph9-f5r6-vhqf"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-25897"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/eclipse/milo/issues/1030"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/eclipse/milo/pull/1031"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/eclipse/milo/commit/4534381760d7d9f0bf00cbf6a8449bb0d13c6ce5"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/eclipse/milo"
  }, {
    "type" : "WEB",
    "url" : "https://security.snyk.io/vuln/SNYK-JAVA-ORGECLIPSEMILO-2990191"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-770" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-09-15T03:35:46Z",
    "nvd_published_at" : "2022-09-08T05:15:00Z"
  }
}