Google discloses serious bug in Libgcrypt cryptography library – affecting many projects

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

The flaw, which affects version 1.9.0 of libgcrypt, was discovered on January 28 by Tavis Ormandy of Project Zero, a Google security research unit 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 can overload a heap buffer with data controlled by the attacker, no verification or signature is validated before the vulnerability occurs.”

password auditor

GnuPG addressed the weakness almost immediately the day after its release, 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 offered as part of the GnuPG software package for encrypting and signing data and communications. An implementation of OpenPGP, 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 its development phase, two years ago, as part of a change to “reduce overhead in the generic hash recording function”, but it was only detected in last week by Google Project Zero.

So, all an attacker needs to do to trigger this critical flaw is to send the library a block of data specially created to decrypt, thus tricking the application into executing an arbitrary fragment of malicious code embedded in it (also known as a shellcode) or blocking a program (in this case, gpg) that depends on the Libgcrypt library.

“Exploring this bug is simple and therefore immediate action for 1.9.0 users is necessary,” noted Libgcrypt author Werner Koch. “The 1.9.0 tarballs on our FTP server have been renamed so that the scripts are no longer able to obtain this version.”

.Source