CVE-2026-0965: Libssh: libssh: denial of service via improper configuration file handling
A flaw was found in libssh where it can attempt to open arbitrary files during configuration parsing. A local attacker can exploit this by providing a malicious configuration file or when the system is misconfigured. This vulnerability could lead to a Denial of Service (DoS) by causing the system to try and access dangerous files, such as block devices or large system files, which can disrupt normal operations.
Other sources
libssh can try to open any file during configuration parsing, when misconfigured or when local attacker can provide malicious configuration. This applies for all configuration loaded from default location, configuration provided through the sshconfigparsefile() and sshbindconfigparsefile() functions as well as configuration files included from them directly or through glob wildcards.
The possibly dangerous files involve block devices, fifo, named pipe or huge system files that could cause Denial of Service.
The solution here is allowing to read only regular files and enforcing configuration file size limit of 16MB. Currently, maximum line length of a configuration file is 1K so this will effectively mean configuration files of 16K lines should still keep working.
— Red Hat
Libssh: libssh: denial of service via improper configuration file handling
— Microsoft
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Configuration
Modify libssh configuration parsing so that configuration is read only from regular files; prevent opening dangerous file types (e.g., block devices and fifo/named pipe) during configuration parsing for all configuration loaded from the default location and for files referenced via direct include/glob wildcards.
libssh ssh_bind_config_parse_file() / ssh_config_parse_file() configuration file handling = Allow reading only regular files (deny block devices, FIFOs/named pipes, and other non-regular files) - Configuration
Enforce a maximum configuration file size limit of 16MB for configuration parsing in ssh_bind_config_parse_file() / ssh_config_parse_file() to reduce DoS risk from huge system files.
libssh configuration file size limit = 16MB - Configuration
Ensure that configurations provided via ssh_config_parse_file() that are 16K lines or fewer continue to work while preventing DoS from excessively large inputs.
libssh maximum number of configuration lines from ssh_config_parse_file() = 16K lines
Event History
Frequently Asked Questions
What is the severity of CVE-2026-0965?
CVE-2026-0965 is classified as a denial of service vulnerability due to improper configuration file handling in libssh.
How do I fix CVE-2026-0965?
To mitigate CVE-2026-0965, ensure that your libssh configuration files are secure and do not include arbitrary file references.
Who is affected by CVE-2026-0965?
CVE-2026-0965 affects users of libssh who utilize improper configuration files.
What causes CVE-2026-0965?
CVE-2026-0965 is caused by libssh's improper handling of configuration files that can lead to attempts at opening arbitrary files.
Can CVE-2026-0965 be exploited remotely?
CVE-2026-0965 primarily requires local access for exploitation, so remote exploitation is unlikely without local privileges.