CVE Database›Document archive›CVE-2016-7798

CVE-2016-7798

ruby: IV Reuse in GCM Mode

Loading…

Severity

Moderate

Red Hat Product Security

3.7

CVSS 3.0

Review impact separately from score.

Published · September 19, 2016

Updated · May 13, 2026

Description

The openssl gem for Ruby uses the same initialization vector (IV) in GCM Mode (aes-*-gcm) when the IV is set before the key, which makes it easier for context-dependent attackers to bypass the encryption protection mechanism.

CVSS score applicability

The CVSS score(s) listed for this vulnerability do not reflect the associated product's status, and are included for informational purposes to better understand the severity of this vulnerability.

Mitigation

A possible workaround to this flaw is, when using aes-256-gcm mode, always set the key first and then the iv. For example when setting random keys and iv use the following code segment:

key = cipher.random_key iv = cipher.random_iv

CVSS / CWE

CVSS 3.0 · 3.7
CVSS:3.0/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:N

CVSS 2.0 · 4.3
AV:N/AC:M/Au:N/C:P/I:N/A:N

CWE not specified