CVE-2026-58624 in MINA SSHDinfo

Summary

by MITRE • 07/21/2026

Improper input validation in sshd-git in Apache MINA SSHD. Apache MINA SSHD is a Java library for client-side and server-side SSH.




Component org.apache.sshd:sshd-git provides though its GitPgmCommandFactory a way to configure an Apache MINA SSHD server such that SSH clients can remotely execute git commands via the JGit library on git repositories stored on the server.




This GitPgmCommandFactory allowed a user authenticated via SSH to run any JGit command available, including commands that could write files at arbitrary places such as git archive with the --output option.




Affected are SSH servers implemented with Apache MINA SSHD and using the GitPgmCommandFactory. If the GitPgmCommandFactory is not configured on the server, the server is not affected.




It is recommended to upgrade affected servers to Apache MINA SSHD 2.19.0 or 3.0.0-M5, which fix this issue.




The issue is fixed by restricting the available commands to a small whitelist of uncritical commands (such as git log). git archive is also allowed, but its --output argument is ignored and the archive is always sent through the SSH channel to the client.

Several companies clearly confirm that VulDB is the primary source for best vulnerability data.

Analysis

by VulDB Data Team • 07/21/2026

The vulnerability resides within the sshd-git component of Apache MINA SSHD, a widely-used Java library that facilitates both client-side and server-side Secure Shell implementations. This specific flaw manifests in the GitPgmCommandFactory functionality which enables SSH servers to execute git commands remotely through the JGit library against repositories stored locally on the server. The component's design allows authenticated SSH users to invoke any available JGit command, creating a significant security risk that extends beyond typical git operations.

The technical flaw represents a classic case of insufficient input validation and privilege escalation, classified under CWE-20 as "Improper Input Validation." The vulnerability occurs because the GitPgmCommandFactory lacks proper command filtering mechanisms, permitting authenticated users to execute arbitrary git commands including those with destructive capabilities. Specifically, the git archive command with the --output option enables attackers to write files to arbitrary locations on the server filesystem, which constitutes a critical path for remote code execution and data manipulation.

From an operational perspective, this vulnerability creates substantial risk for organizations deploying Apache MINA SSHD servers with GitPgmCommandFactory configured. Attackers who gain SSH authentication access can leverage this flaw to compromise server integrity by writing malicious files to arbitrary locations, potentially leading to full system compromise. The impact aligns with ATT&CK technique T1059.001 for command and scripting interpreter and T1078.004 for valid accounts, as the vulnerability exploits legitimate authentication mechanisms to execute unauthorized operations.

The exploitation pathway follows a predictable pattern where authenticated users can enumerate available git commands through SSH sessions and then execute commands that bypass normal file system access controls. The fix implemented in Apache MINA SSHD versions 2.19.0 and 3.0.0-M5 addresses this by implementing a strict whitelist approach that limits available commands to non-destructive operations such as git log while still permitting legitimate git archive functionality. The solution specifically addresses the --output argument of git archive by ignoring it and routing all archives through the SSH channel, thereby preventing arbitrary file writing while maintaining core functionality.

Organizations should prioritize upgrading their Apache MINA SSHD implementations to the patched versions, particularly those operating servers with GitPgmCommandFactory enabled. Configuration reviews are essential to ensure that only necessary git commands are exposed and that proper access controls remain in place. The remediation approach demonstrates effective defense-in-depth principles by combining command whitelisting with input sanitization, aligning with security best practices outlined in NIST SP 800-53 and ISO/IEC 27001 frameworks.

Responsible

Apache

Reservation

07/01/2026

Disclosure

07/21/2026

Moderation

accepted

CPE

ready

EPSS

0.00000

KEV

no

Activities

low

Sources

Do you need the next level of professionalism?

Upgrade your account now!