Libgcrypt Vulnerability: Weak Random Number Generation

libgcrypt Updated 02 Oct 2025

Summary

13/12/2016
N/A
Yes i
Medium
5.3

ALPINE-CVE-2016-6313: The mixing functions in the random number generator in Libgcrypt before 1.5.6, 1.6.x before 1.6.6, and 1.7.x before 1.7.3 and GnuPG before 1.4.21 make it easier for attackers to obtain the values of 160 bits by leveragin... Affects libgcrypt versions < 1.7.0-r1. Fixed in 1.7.0-r1. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Your last release was probably never penetration tested Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

Libgcrypt is a cryptographic library that provides a wide range of cryptographic functions, including encryption, decryption, and secure random number generation. It is widely used in various applications, including GnuPG, to ensure data security. However, certain versions of Libgcrypt are vulnerable to a weakness in their random number generator, which can compromise the security of cryptographic operations.

Vulnerability Detail

The vulnerability identified as CVE-2016-6313 affects Libgcrypt versions prior to 1.5.6, 1.6.x before 1.6.6, and 1.7.x before 1.7.3. The issue lies in the mixing functions of the random number generator, which can allow attackers to predict the output of the generator. By leveraging knowledge of previously generated bits, an attacker could potentially obtain the values of 160 bits, undermining the security of cryptographic operations that rely on secure random number generation. This vulnerability poses a significant risk, particularly in applications that depend on the integrity of cryptographic keys and secure communications.

How To Fix

Minimum fixed version

1.7.0-r1

This is the first release that contains the fix.

sudo apk add --upgrade libgcrypt

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

If immediate upgrading is not feasible, consider implementing additional layers of security, such as using alternative cryptographic libraries or mechanisms that do not rely on the vulnerable random number generator until the update can be applied.

Conclusion

The vulnerability in Libgcrypt's random number generator poses a significant risk to applications relying on secure cryptographic functions. It is crucial to update to the patched version to mitigate this risk. Users are encouraged to monitor their applications for vulnerabilities using tools like Vulert, which can alert in real-time for open-source vulnerabilities.

See every vulnerability recorded for libgcrypt →

Share this vulnerability

FAQ

CVE-2016-6313 is a vulnerability in Libgcrypt that affects its random number generator, allowing attackers to predict generated values.

Libgcrypt versions before 1.5.6, 1.6.x before 1.6.6, and 1.7.x before 1.7.3 are vulnerable.

Attackers could potentially predict cryptographic keys, compromising the security of encrypted data and communications.

You can use Vulert's playground at Vulert Scanner to check if your application is affected by this vulnerability without needing to sign up.

The CVSS score for CVE-2016-6313 is 5.3, indicating a moderate level of severity.

Related vulnerabilities

Recent vulnerabilities recorded for libgcrypt.

How To Fix

Minimum fixed version

1.7.0-r1

This is the first release that contains the fix.

sudo apk add --upgrade libgcrypt

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback