CVE-2026-66035
Wolfi Analyse et atténuation des vulnérabilités

Aperçu

CVE-2026-66035 is a pre-authentication heap buffer overflow vulnerability in libssh2 affecting all versions through 1.11.1. The flaw resides in the fullpacket() function in src/transport.c and can be triggered by a malicious SSH server during Encrypt-then-MAC (ETM) cipher negotiation, before any authentication occurs. It was disclosed on July 24, 2026, and fixed in commit 42e33d8. The vulnerability carries a CVSS v3.1 score of 7.5 (High) and a CVSS v4.0 score of 7.7 (High) (GitHub Advisory, VulnCheck).

Détails techniques

The root cause is a heap-based buffer overflow (CWE-122) in the ETM decryption path of transport_fullpacket() in src/transport.c. When a malicious SSH server sends a packet with a packet_length smaller than the cipher's block size during ETM cipher negotiation, the code allocates a buffer of packet_length bytes but then copies blocksize - 1 bytes via memcpy, writing beyond the allocated buffer. On 32-bit glibc systems, this overflow writes attacker-controlled bytes into an adjacent heap chunk's SIZE field, enabling tcache bin confusion, overlapping live objects, and ultimately a function pointer overwrite during the session handshake — all before authentication. The fix (commit 42e33d8) adds a lower-bound check ensuring p->total_num >= mac_len + 4 + blocksize before proceeding with allocation and decryption (GitHub PR #2198, Fix Commit).

Impact

Successful exploitation allows an unauthenticated attacker operating a malicious SSH server to achieve remote code execution with the privileges of the SSH client process. The attack corrupts heap metadata during the session handshake, enabling function pointer overwrite that can lead to full compromise of confidentiality, integrity, and availability of the affected client system. Any application or user connecting to an attacker-controlled SSH server using a vulnerable version of libssh2 is at risk, including automated scripts, CI/CD pipelines, and file transfer tools that rely on the library (GitHub Advisory, VulnCheck).

Étapes d’exploitation

  1. Set up a malicious SSH server: Configure or modify an SSH server implementation to send crafted SSH packets during the handshake phase, specifically advertising ETM (Encrypt-then-MAC) cipher suites.
  2. Negotiate ETM cipher: During the SSH key exchange with a connecting libssh2 client, ensure the ETM cipher mode is selected (e.g., aes128-ctr with ETM MAC).
  3. Send undersized packet: Transmit a packet where packet_length is set to a value smaller than the cipher's block size. This causes the fullpacket() function in src/transport.c to allocate a buffer of packet_length bytes.
  4. Trigger heap overflow: The ETM path copies blocksize - 1 bytes via memcpy into the undersized buffer, overflowing into the adjacent heap chunk's metadata (specifically the SIZE field on 32-bit glibc).
  5. Corrupt heap metadata: The overflow writes attacker-controlled bytes, enabling tcache bin confusion and overlapping live heap objects.
  6. Overwrite function pointer: Leverage the corrupted heap state to overwrite a function pointer used during the session handshake, redirecting execution to attacker-controlled code before authentication completes.
  7. Achieve code execution: Arbitrary code executes with the privileges of the libssh2 client process (GitHub PR #2198, GitHub Advisory).

Indicateurs de compromis

  • Network: Outbound SSH connections (TCP port 22) from client systems to unexpected or newly observed IP addresses; SSH handshake traffic that terminates abnormally or produces client-side crashes.
  • Process: Unexpected child processes spawned by applications using libssh2 (e.g., curl, git, sftp clients) immediately after an SSH connection attempt; application crashes or core dumps during SSH session establishment.
  • Logs: Application error logs showing LIBSSH2_ERROR_DECRYPT or abnormal SSH handshake failures when connecting to specific servers; repeated connection failures to the same remote host.
  • File System: Unexpected core dump files (core.*) in application working directories following SSH connection attempts; new or modified files created by the libssh2 client process after a connection to an untrusted server.

Atténuation et solutions de contournement

Update libssh2 to a version containing commit 42e33d81577ed4b95d4b4f6f845e5ee8efe5eeb4 or later, which adds a bounds check in transport_fullpacket() to validate packet size before allocation. As a workaround where patching is not immediately possible, restrict SSH client connections to only trusted, known-good SSH servers via network controls (firewall rules, allowlists). Disable ETM cipher suites in libssh2-based applications if the library or application configuration permits cipher negotiation control. Monitor for new official releases from the libssh2 project that incorporate this fix (GitHub PR #2198, Fix Commit).

Ressources additionnelles


SourceCe rapport a été généré à l’aide de l’IA

Apparenté Wolfi Vulnérabilités:

Identifiant CVE

Sévérité

Score

Technologies

Nom du composant

Exploit CISA KEV

A corrigé

Date de publication

CVE-2026-66033HIGH8.7
  • Wolfi logoWolfi
  • libssh2
NonNonJul 24, 2026
CVE-2026-66032HIGH8.7
  • Wolfi logoWolfi
  • libssh2
NonNonJul 24, 2026
CVE-2026-66035HIGH7.7
  • Wolfi logoWolfi
  • libssh2
NonNonJul 24, 2026
CVE-2026-66034HIGH7.7
  • Wolfi logoWolfi
  • libssh2
NonNonJul 24, 2026
CVE-2026-56392LOW1.8
  • Wolfi logoWolfi
  • coreutils-single
NonNonJul 24, 2026

Évaluation gratuite des vulnérabilités

Évaluez votre posture de sécurité dans le cloud

Évaluez vos pratiques de sécurité cloud dans 9 domaines de sécurité pour évaluer votre niveau de risque et identifier les failles dans vos défenses.

Demander une évaluation

Obtenez une démo personnalisée

Prêt(e) à voir Wiz en action ?

"La meilleure expérience utilisateur que j’ai jamais vue, offre une visibilité totale sur les workloads cloud."
David EstlickRSSI
"Wiz fournit une interface unique pour voir ce qui se passe dans nos environnements cloud."
Adam FletcherChef du service de sécurité
"Nous savons que si Wiz identifie quelque chose comme critique, c’est qu’il l’est réellement."
Greg PoniatowskiResponsable de la gestion des menaces et des vulnérabilités