Google exposes serious bug in Libgcrypt encryption library – affecting many projects

A “serious” vulnerability in GNU Privacy Guard’s Libgcrypt encryption software (GnuPG) could have allowed an attacker to write arbitrary data to the target machine, potentially leading to remote code execution.

The bug, affecting version 1.9.0 of libgcrypt, was discovered on January 28 by Tavis Ormandy of Project Zero, a security research unit within Google dedicated to finding zero-day bugs in hardware and software systems.

No other version of Libgcrypt is affected by the vulnerability.

“There is a heap buffer overflow in libgcrypt due to an incorrect assumption in the block buffer management code,” said Ormandy. Just decrypting some data could flood a heap buffer with attacker-verified data. No authentication or signature is validated before the vulnerability occurs.

password auditor

GnuPG fixed the weakness almost immediately within a day of disclosure, while urging users to stop using the vulnerable version. The latest version can be downloaded here.

The Libgcrypt library is an open-source cryptographic toolkit provided as part of the GnuPG software suite to encrypt and sign data and communications. An implementation of OpenPGP, it is used for digital security in many Linux distributions such as Fedora and Gentoo, although it is not as widely used as OpenSSL or LibreSSL.

According to GnuPG, the bug appears to have been introduced in 1.9.0 during the development phase two years ago as part of a change to “reduce overhead on generic hash write functions,” but it was only spotted by Google Project Zero last week.

All an attacker needs to do to trigger this critical flaw is send the library a block of specially crafted data to decrypt, tricking the application into executing any snippet of malicious code contained within embedded (also called shellcode) or crash a program. (gpg in this case) which depends on the Libgcrypt library.

“Exploiting this bug is easy and therefore requires immediate action for 1.9.0 users,” noted Libgcrypt author Werner Koch. “The 1.9.0 tarballs on our FTP server have been renamed so scripts can no longer get this version.”

.Source