Cloudanix VulnDB

CVE-2017-11671

Medium · 4.0

CVSS

4.0

EPSS

0.5%

Published

Jul 26, 2017

CISA due date

—

Cloudanix analysis

Monitor only SSVC: Track

An old compiler bug can cause programs to use unreliable random numbers, making security features that depend on those numbers easier to break.

Exploitation
Local Privilege
Attacker needs
Local User
Complexity
Low
Impact
Data Exposure
Component
Application
Class
Cryptographic Weakness
Remediation
Upgrade
Effort
Medium
Patch risk
Medium

What it actually does

The ix86_expand_builtin function in affected GCC versions emits instruction sequences for RDRAND and RDSEED intrinsics that overwrite the carry flag before the caller can test it, silently turning failed hardware RNG operations into apparent successes and returning uninitialized or low-entropy values.

Why it matters to the business

Applications compiled with the affected compiler versions may silently receive predictable or low-quality random numbers, weakening cryptographic keys, nonces, and tokens that rely on those intrinsics and increasing the chance of successful attacks against encryption, authentication, or session management.

How an attack unfolds

An attacker identifies software that was built with an affected GCC release and uses RDRAND/RDSEED intrinsics, then supplies inputs that trigger the flawed code path; because the carry flag is clobbered, the generated binary treats a failed hardware call as success and proceeds with whatever value is left in the destination register, allowing the attacker to observe or brute-force the resulting low-entropy output.

How to fix it

Upgrade to GCC 5.5 or 6.4 (or any later supported release) and rebuild all affected binaries that use the RDRAND or RDSEED intrinsics; where immediate rebuild is impossible, replace intrinsic usage with a software fallback that properly checks hardware status or uses a vetted library RNG.

How to confirm the fix worked

Recompile a test program that calls the intrinsics under the fixed compiler, disassemble the generated code, and confirm that the carry flag is tested immediately after the RDRAND/RDSEED instruction before any other flag-modifying operations occur; also verify that the binary no longer ships with the vulnerable pattern by searching for the known clobber sequence in object files.

Typical attack path

  1. Compile or obtain a binary linked against code that calls RDRAND/RDSEED intrinsics using GCC 4.6–6.3
  2. Deploy or execute the resulting binary on a system where the hardware RNG occasionally fails or returns status via the carry flag
  3. Observe or force conditions that cause the intrinsic to be reached with a failed hardware operation
  4. Consume the unvalidated random value in cryptographic or security-sensitive operations
  5. Exploit the resulting predictability in keys, nonces, or tokens

How to detect it

Search build logs, package manifests, and binary metadata for compilation records that list GCC versions 4.6 through 6.3; inspect disassembled object files or core dumps for RDRAND/RDSEED sequences that lack an immediate carry-flag test; review application logs for unusually predictable random values or cryptographic failures that coincide with the use of affected binaries.

What your security team should do

  • Inventory all build pipelines and third-party packages built with GCC 4.6–6.3 and prioritize rebuilds for any that link against cryptographic code
  • Add compiler version checks to CI/CD pipelines so that builds using unsupported or vulnerable GCC releases are rejected
  • Replace direct intrinsic calls with portable, status-checked RNG wrappers from a maintained library
  • Monitor EPSS and KEV feeds for any future increase in exploitation of this class of compiler-induced RNG weakness

The record

Under certain circumstances, the ix86_expand_builtin function in i386.c in GNU Compiler Collection (GCC) version 4.6, 4.7, 4.8, 4.9, 5 before 5.5, and 6 before 6.4 will generate instruction sequences that clobber the status flag of the RDRAND and RDSEED intrinsics before it can be read, potentially causing failures of these instructions to go unreported. This could potentially lead to less randomness in random number generation.

Affected packages

Ecosystem Package Introduced Fixed
Red Hat:enterprise_linux:7::client cpp 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::client gcc 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::client gcc-base-debuginfo 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::client gcc-c++ 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::client gcc-debuginfo 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::client gcc-gfortran 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::client gcc-gnat 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::client gcc-go 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::client gcc-objc 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::client gcc-objc++ 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::client gcc-plugin-devel 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::client libasan 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::client libasan-static 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::client libatomic 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::client libatomic-static 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::client libgcc 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::client libgfortran 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::client libgfortran-static 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::client libgnat 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::client libgnat-devel 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::client libgnat-static 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::client libgo 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::client libgo-devel 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::client libgo-static 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::client libgomp 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::client libitm 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::client libitm-devel 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::client libitm-static 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::client libmudflap 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::client libmudflap-devel 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::client libmudflap-static 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::client libobjc 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::client libquadmath 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::client libquadmath-devel 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::client libquadmath-static 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::client libstdc++ 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::client libstdc++-devel 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::client libstdc++-docs 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::client libstdc++-static 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::client libtsan 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::client libtsan-static 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::computenode cpp 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::computenode gcc 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::computenode gcc-base-debuginfo 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::computenode gcc-c++ 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::computenode gcc-debuginfo 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::computenode gcc-gfortran 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::computenode gcc-gnat 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::computenode gcc-go 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::computenode gcc-objc 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::computenode gcc-objc++ 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::computenode gcc-plugin-devel 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::computenode libasan 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::computenode libasan-static 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::computenode libatomic 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::computenode libatomic-static 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::computenode libgcc 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::computenode libgfortran 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::computenode libgfortran-static 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::computenode libgnat 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::computenode libgnat-devel 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::computenode libgnat-static 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::computenode libgo 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::computenode libgo-devel 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::computenode libgo-static 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::computenode libgomp 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::computenode libitm 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::computenode libitm-devel 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::computenode libitm-static 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::computenode libmudflap 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::computenode libmudflap-devel 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::computenode libmudflap-static 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::computenode libobjc 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::computenode libquadmath 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::computenode libquadmath-devel 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::computenode libquadmath-static 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::computenode libstdc++ 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::computenode libstdc++-devel 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::computenode libstdc++-docs 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::computenode libstdc++-static 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::computenode libtsan 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::computenode libtsan-static 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::server cpp 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::server gcc 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::server gcc-base-debuginfo 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::server gcc-c++ 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::server gcc-debuginfo 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::server gcc-gfortran 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::server gcc-gnat 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::server gcc-go 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::server gcc-objc 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::server gcc-objc++ 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::server gcc-plugin-devel 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::server libasan 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::server libasan-static 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::server libatomic 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::server libatomic-static 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::server libgcc 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::server libgfortran 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::server libgfortran-static 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::server libgnat 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::server libgnat-devel 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::server libgnat-static 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::server libgo 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::server libgo-devel 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::server libgo-static 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::server libgomp 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::server libitm 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::server libitm-devel 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::server libitm-static 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::server libmudflap 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::server libmudflap-devel 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::server libmudflap-static 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::server libobjc 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::server libquadmath 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::server libquadmath-devel 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::server libquadmath-static 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::server libstdc++ 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::server libstdc++-devel 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::server libstdc++-docs 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::server libstdc++-static 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::server libtsan 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::server libtsan-static 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::workstation cpp 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::workstation gcc 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::workstation gcc-base-debuginfo 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::workstation gcc-c++ 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::workstation gcc-debuginfo 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::workstation gcc-gfortran 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::workstation gcc-gnat 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::workstation gcc-go 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::workstation gcc-objc 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::workstation gcc-objc++ 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::workstation gcc-plugin-devel 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::workstation libasan 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::workstation libasan-static 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::workstation libatomic 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::workstation libatomic-static 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::workstation libgcc 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::workstation libgfortran 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::workstation libgfortran-static 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::workstation libgnat 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::workstation libgnat-devel 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::workstation libgnat-static 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::workstation libgo 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::workstation libgo-devel 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::workstation libgo-static 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::workstation libgomp 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::workstation libitm 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::workstation libitm-devel 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::workstation libitm-static 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::workstation libmudflap 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::workstation libmudflap-devel 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::workstation libmudflap-static 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::workstation libobjc 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::workstation libquadmath 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::workstation libquadmath-devel 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::workstation libquadmath-static 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::workstation libstdc++ 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::workstation libstdc++-devel 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::workstation libstdc++-docs 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::workstation libstdc++-static 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::workstation libtsan 0 0:4.8.5-28.el7
Red Hat:enterprise_linux:7::workstation libtsan-static 0 0:4.8.5-28.el7
SUSE:Linux Enterprise Desktop 12 SP2 gcc48 0 4.8.5-31.3.1
SUSE:Linux Enterprise Desktop 12 SP2 libgcj48 0 4.8.5-31.3.1
SUSE:Linux Enterprise Desktop 12 SP3 gcc48 0 4.8.5-31.3.1
SUSE:Linux Enterprise Desktop 12 SP3 libgcj48 0 4.8.5-31.3.1
SUSE:Linux Enterprise Server 12 SP1-LTSS gcc48 0 4.8.5-31.3.1
SUSE:Linux Enterprise Server 12 SP2 gcc48 0 4.8.5-31.3.1
SUSE:Linux Enterprise Server 12 SP3 gcc48 0 4.8.5-31.3.1
SUSE:Linux Enterprise Server 12-LTSS gcc48 0 4.8.5-31.3.1
SUSE:Linux Enterprise Server for Raspberry Pi 12 SP2 gcc48 0 4.8.5-31.3.1
SUSE:Linux Enterprise Server for SAP Applications 12 SP1 gcc48 0 4.8.5-31.3.1
SUSE:Linux Enterprise Server for SAP Applications 12 SP2 gcc48 0 4.8.5-31.3.1
SUSE:Linux Enterprise Server for SAP Applications 12 SP3 gcc48 0 4.8.5-31.3.1
SUSE:Linux Enterprise Software Development Kit 11 SP4 gcc48 0 4.8.5-5.3.1
SUSE:Linux Enterprise Software Development Kit 12 SP2 gcc48 0 4.8.5-31.3.1
SUSE:Linux Enterprise Software Development Kit 12 SP2 libffi48 0 4.8.5-31.3.1
SUSE:Linux Enterprise Software Development Kit 12 SP2 libgcj48 0 4.8.5-31.3.1
SUSE:Linux Enterprise Software Development Kit 12 SP3 gcc48 0 4.8.5-31.3.1
SUSE:Linux Enterprise Software Development Kit 12 SP3 libffi48 0 4.8.5-31.3.1
SUSE:Linux Enterprise Software Development Kit 12 SP3 libgcj48 0 4.8.5-31.3.1
SUSE:Linux Enterprise Workstation Extension 12 SP2 libgcj48 0 4.8.5-31.3.1
SUSE:Linux Enterprise Workstation Extension 12 SP3 libgcj48 0 4.8.5-31.3.1
SUSE:OpenStack Cloud 6 gcc48 0 4.8.5-31.3.1
Ubuntu:14.04:LTS gcc-3.3 0 No fix
Ubuntu:14.04:LTS gcc-4.7 0 No fix
Ubuntu:14.04:LTS gcc-4.8 0 No fix
Ubuntu:14.04:LTS gcc-mingw-w64 0 No fix
Ubuntu:14.04:LTS gccgo-4.9 0 No fix
Ubuntu:16.04:LTS gcc-3.3 0 No fix
Ubuntu:16.04:LTS gcc-4.7 0 No fix
Ubuntu:16.04:LTS gcc-4.7-armel-cross 0 No fix
Ubuntu:16.04:LTS gcc-4.7-armhf-cross 0 No fix
Ubuntu:16.04:LTS gcc-4.8 0 No fix
Ubuntu:16.04:LTS gcc-4.8-arm64-cross 0 No fix
Ubuntu:16.04:LTS gcc-4.8-armhf-cross 0 No fix
Ubuntu:16.04:LTS gcc-4.8-powerpc-cross 0 No fix
Ubuntu:16.04:LTS gcc-4.8-ppc64el-cross 0 No fix

Related vulnerabilities