Vulnerabilities in pkg:maven/org.apache.sshd/sshd-mina

PACKAGE
Advisory Identifier: GHSA-9279-7hph-r3xw
Advisory Summary

CVE-2021-30129 is a HIGH (CVSS 7.5) buffer overflow vulnerability (CWE-772: Missing Release of Resource after Effective Lifetime) affecting Sshd mina libraries in the Maven ecosystem. The issue involves buffer overflow in apache mina sshd. Remediation is available by upgrading affected packages to version 2.7.0.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:maven/org.apache.sshd/sshd-mina

1 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:maven/org.apache.sshd/sshd-mina. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-9279-7hph-r3xw CVE-2021-30129 HIGH Buffer Overflow in Apache Mina SSHD

CVE-2021-30129 at a Glance

CVE Identifier CVE-2021-30129
GHSA Identifier GHSA-9279-7hph-r3xw
Severity HIGH
CVSS v3.1 Base Score 7.5
CWE Classification CWE-772: Missing Release of Resource after Effective Lifetime
Affected Product Sshd mina
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-2021-30129

To remediate this vulnerability, upgrade all affected Sshd mina 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.sshd:sshd-mina fixed: 2.7.0
<dependency>
    <groupId>org.apache.sshd</groupId>
    <artifactId>sshd-mina</artifactId>
    <version>2.7.0</version>
</dependency>
org.apache.sshd:sshd-core fixed: 2.7.0
<dependency>
    <groupId>org.apache.sshd</groupId>
    <artifactId>sshd-core</artifactId>
    <version>2.7.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.sshd

How to Check if You Are Affected

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

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

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

Note: The mvn dependency:tree -Dincludes=org.apache.sshd 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-772: Missing Release of Resource after Effective Lifetime, where the product does not release a resource after its effective lifetime has ended, i.e., after the resource is no longer needed. In Sshd mina, 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 vulnerability in sshd-core of Apache Mina SSHD allows an attacker to overflow the server causing an OutOfMemory error. This issue affects the SFTP and port forwarding features of Apache Mina SSHD version 2.0.0 and later versions. It was addressed in Apache Mina SSHD 2.7.0

CVE-2021-30129 Affected Sshd mina Versions

2 component(s)
Fixed Versions:
2.7.0
Product / Package Ecosystem Affected Versions Fixed Version
org.apache.sshd:sshd-mina
Maven
≥ 2.0.0
< 2.7.0
2.7.0
org.apache.sshd:sshd-core
Maven
≥ 2.0.0
< 2.7.0
2.7.0

References

Frequently Asked Questions

What is CVE-2021-30129?
CVE-2021-30129 is a security vulnerability in Sshd mina involving Buffer Overflow in Apache Mina SSHD under CWE-772: Missing Release of Resource after Effective Lifetime.
Which Sshd mina versions are affected?
Affected versions include releases prior to 2.7.0 across affected packages: org.apache.sshd:sshd-mina, org.apache.sshd:sshd-core.
What version fixes CVE-2021-30129?
Upgrading to 2.7.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is sshd-mina affected?
Yes, org.apache.sshd:sshd-mina is affected in releases prior to 2.7.0. Upgrade your dependency to 2.7.0 or later.
Is sshd-core affected?
Yes, org.apache.sshd:sshd-core is affected in releases prior to 2.7.0. Upgrade your dependency to 2.7.0 or later.
What is the CVSS score of CVE-2021-30129?
CVE-2021-30129 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-2021-30129?
CVE-2021-30129 is classified under CWE-772: Missing Release of Resource after Effective Lifetime (The product does not release a resource after its effective lifetime has ended, i.e., after the resource is no longer needed.).
How can I check Maven dependencies for CVE-2021-30129?
Run the dependency tree command: 'mvn dependency:tree -Dincludes=org.apache.sshd'. 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-9279-7hph-r3xw",
  "modified" : "2021-07-26T23:00:52Z",
  "published" : "2021-08-02T16:54:09Z",
  "aliases" : [ "CVE-2021-30129" ],
  "summary" : "Buffer Overflow in Apache Mina SSHD",
  "details" : "A vulnerability in sshd-core of Apache Mina SSHD allows an attacker to overflow the server causing an OutOfMemory error. This issue affects the SFTP and port forwarding features of Apache Mina SSHD version 2.0.0 and later versions. It was addressed in Apache Mina SSHD 2.7.0",
  "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.apache.sshd:sshd-mina"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.0.0"
      }, {
        "fixed" : "2.7.0"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.apache.sshd:sshd-core"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.0.0"
      }, {
        "fixed" : "2.7.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-30129"
  }, {
    "type" : "WEB",
    "url" : "https://issues.apache.org/jira/browse/SSHD-1125"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread.html/r6d4f78e192a0c8eabd671a018da464024642980ecd24096bde6db36f%40%3Cusers.mina.apache.org%3E"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread.html/r6d4f78e192a0c8eabd671a018da464024642980ecd24096bde6db36f@%3Cusers.mina.apache.org%3E"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread.html/red01829efa2a8c893c4baff4f23c9312bd938543a9b8658e172b853b@%3Cannounce.apache.org%3E"
  }, {
    "type" : "WEB",
    "url" : "https://www.oracle.com/security-alerts/cpuapr2022.html"
  }, {
    "type" : "WEB",
    "url" : "https://www.oracle.com/security-alerts/cpujul2022.html"
  }, {
    "type" : "WEB",
    "url" : "http://www.openwall.com/lists/oss-security/2021/07/12/1"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-772" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2021-07-13T23:19:33Z",
    "nvd_published_at" : "2021-07-12T12:15:00Z"
  }
}