# CVE-2015-5276: Weak cryptography in n/a

> Attackers can predict random values generated by libstdc++ due to improper handling of short reads, potentially compromising cryptographic security.

- **Severity:** Medium 5.0 (`AV:N/AC:L/Au:N/C:P/I:N/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Not stated
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 17 Nov 2015
- **Updated:** 6 Aug 2024
- **Also known as:** GHSA-rq8f-f9q7-5x24, MGASA-2015-0449, SUSE-SU-2015:1833-1, SUSE-SU-2016:0908-2, SUSE-SU-2016:0963-1, SUSE-SU-2017:0379-1, UBUNTU-CVE-2015-5276, openSUSE-SU-2024:10542-1

## What is CVE-2015-5276?

CVE-2015-5276 is a medium-severity vulnerability in n/a, published on 17 Nov 2015. 

### Official description

The std::random_device class in libstdc++ in the GNU Compiler Collection (aka GCC) before 4.9.4 does not properly handle short reads from blocking sources, which makes it easier for context-dependent attackers to predict the random values via unspecified vectors.

Weakness: CWE-200 (Exposure of Sensitive Information to an Unauthorized Actor)

## Which versions are affected by CVE-2015-5276?

It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `gcc5` | SUSE:Linux Enterprise Desktop 11 SP4 | All versions | 5.3.1+r233831-10.1 |
| `gcc48` | SUSE:Linux Enterprise Desktop 12 | All versions | 4.8.5-24.1 |
| `gcc5` | SUSE:Linux Enterprise Desktop 12 | All versions | 5.3.1+r233831-9.1 |
| `libffi-gcc5` | SUSE:Linux Enterprise Desktop 12 | All versions | 5.3.1+r233831-9.1 |
| `libgcj48` | SUSE:Linux Enterprise Desktop 12 | All versions | 4.8.5-24.1 |
| `gcc5` | SUSE:Linux Enterprise Desktop 12 SP1 | All versions | 5.3.1+r233831-9.1 |
| `libffi-gcc5` | SUSE:Linux Enterprise Desktop 12 SP1 | All versions | 5.3.1+r233831-9.1 |
| `gcc5` | SUSE:Linux Enterprise Module for Toolchain 12 | All versions | 5.3.1+r233831-9.1 |
| `libffi-gcc5` | SUSE:Linux Enterprise Module for Toolchain 12 | All versions | 5.3.1+r233831-9.1 |
| `gcc5` | SUSE:Linux Enterprise Server 11 SP4 | All versions | 5.3.1+r233831-10.1 |
| `libffi-gcc5` | SUSE:Linux Enterprise Server 11 SP4 | All versions | 5.3.1+r233831-10.1 |
| `gcc48` | SUSE:Linux Enterprise Server 12 | All versions | 4.8.5-24.1 |
| `gcc5` | SUSE:Linux Enterprise Server 12 | All versions | 5.3.1+r233831-9.1 |
| `libffi-gcc5` | SUSE:Linux Enterprise Server 12 | All versions | 5.3.1+r233831-9.1 |
| `libffi48` | SUSE:Linux Enterprise Server 12 | All versions | 4.8.5-24.1 |
| `gcc5` | SUSE:Linux Enterprise Server 12 SP1 | All versions | 5.3.1+r233831-9.1 |
| `libffi-gcc5` | SUSE:Linux Enterprise Server 12 SP1 | All versions | 5.3.1+r233831-9.1 |
| `gcc5` | SUSE:Linux Enterprise Server for SAP Applications 11 SP4 | All versions | 5.3.1+r233831-10.1 |
| `libffi-gcc5` | SUSE:Linux Enterprise Server for SAP Applications 11 SP4 | All versions | 5.3.1+r233831-10.1 |
| `gcc48` | SUSE:Linux Enterprise Server for SAP Applications 12 | All versions | 4.8.5-24.1 |
| `gcc5` | SUSE:Linux Enterprise Server for SAP Applications 12 | All versions | 5.3.1+r233831-9.1 |
| `libffi-gcc5` | SUSE:Linux Enterprise Server for SAP Applications 12 | All versions | 5.3.1+r233831-9.1 |
| `libffi48` | SUSE:Linux Enterprise Server for SAP Applications 12 | All versions | 4.8.5-24.1 |
| `gcc5` | SUSE:Linux Enterprise Server for SAP Applications 12 SP1 | All versions | 5.3.1+r233831-9.1 |
| `libffi-gcc5` | SUSE:Linux Enterprise Server for SAP Applications 12 SP1 | All versions | 5.3.1+r233831-9.1 |
| `gcc48` | SUSE:Linux Enterprise Software Development Kit 11 SP4 | All versions | 4.8.5-4.2 |
| `gcc5` | SUSE:Linux Enterprise Software Development Kit 11 SP4 | All versions | 5.3.1+r233831-10.1 |
| `libffi-gcc5` | SUSE:Linux Enterprise Software Development Kit 11 SP4 | All versions | 5.3.1+r233831-10.1 |
| `gcc48` | SUSE:Linux Enterprise Software Development Kit 12 | All versions | 4.8.5-24.1 |
| `libffi48` | SUSE:Linux Enterprise Software Development Kit 12 | All versions | 4.8.5-24.1 |
| `libgcj48` | SUSE:Linux Enterprise Software Development Kit 12 | All versions | 4.8.5-24.1 |
| `gcc5` | SUSE:Linux Enterprise Software Development Kit 12 SP1 | All versions | 5.3.1+r233831-9.1 |
| `libgcj48` | SUSE:Linux Enterprise Workstation Extension 12 | All versions | 4.8.5-24.1 |
| `gcc5` | openSUSE:Tumbleweed | All versions | 5.4.1+r240125-1.5 |

Products: Gnu Gcc.

## How do I fix CVE-2015-5276?

Upgrade to a fixed version.

## Is CVE-2015-5276 being exploited?

There is no known exploitation of CVE-2015-5276 in the wild and no public exploit code.

## Other vulnerabilities in n/a

- [CVE-2018-12886](https://insights.sbomify.com/CVE-2018-12886/): Security feature bypass in n/a (high 8.1)
- [CVE-2002-2439](https://insights.sbomify.com/CVE-2002-2439/): Integer overflow in the new[] operator in gcc before 4.8.0 allows attackers to have unspecified impacts. (high 7.8)
- [CVE-2019-15847](https://insights.sbomify.com/CVE-2019-15847/): Weak cryptography in n/a (high 7.5)
- [CVE-2008-1367](https://insights.sbomify.com/CVE-2008-1367/): Memory corruption in n/a (high 7.5)
- [CVE-2008-1685](https://insights.sbomify.com/CVE-2008-1685/): Integer overflow in n/a (medium 6.8)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2015-5276 and fix it if it is affected.

What it is: CVE-2015-5276 is a medium-severity vulnerability in n/a, published on 17 Nov 2015. 
Exploitation: There is no known exploitation of CVE-2015-5276 in the wild and no public exploit code.

Affected product: n/a. No package-level version data is available, so check the vendor advisory linked from the reference page.

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2015-5276/ (Markdown: https://insights.sbomify.com/CVE-2015-5276/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2015-5276
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2015-5276
- OSV: https://osv.dev/vulnerability/CVE-2015-5276

---
From sbomify Insights: https://insights.sbomify.com/CVE-2015-5276/
Summaries are generated and may contain mistakes; the official description above is the record.
