# CVE-2019-16782: Possible Information Leak / Session Hijack Vulnerability in Rack

> Attackers can hijack sessions via timing attacks on session ID lookups in the Rack library, leading to unauthorized access.

- **Severity:** Medium 6.3 (`CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:H/I:N/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Any signed-in user
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 18 Dec 2019
- **Updated:** 5 Aug 2024
- **Also known as:** DEBIAN-CVE-2019-16782, GHSA-hrqr-hxpp-chr3, RHSA-2020:2480, SUSE-SU-2021:1162-1, UBUNTU-CVE-2019-16782

## What is CVE-2019-16782?

CVE-2019-16782 is a medium-severity vulnerability in Fedoraproject Fedora, published on 18 Dec 2019. Any signed-in user can exploit it over the network, with no action from the victim.

### Official description

There's a possible information leak / session hijack vulnerability in Rack (RubyGem rack). This vulnerability is patched in versions 1.6.12 and 2.0.8. Attackers may be able to find and hijack sessions by using timing attacks targeting the session id. Session ids are usually stored and indexed in a database that uses some kind of scheme for speeding up lookups of that session id. By carefully measuring the amount of time it takes to look up a session, an attacker may be able to find a valid session id and hijack the session. The session id itself may be generated randomly, but the way the session is indexed by the backing store does not use a secure comparison.

Weakness: CWE-203 (Observable Discrepancy), CWE-208 (Observable Timing Discrepancy)

## Which versions are affected by CVE-2019-16782?

4 open source packages ship an affected version, including rack. It affects 3 products.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `rack` | RubyGems | All versions | 1.6.12 |
| `rack` | RubyGems | All versions | 1.6.12 |
| `rack` | RubyGems | From 2.0.0 | 2.0.8 |
| `rack` | RubyGems | From 2.0.0 | 2.0.8 |
| `ansible-runner` | Red Hat:cloudforms_managementengine:5.11::el8 | All versions | 0:1.4.6-1.el8ar |
| `cfme` | Red Hat:cloudforms_managementengine:5.11::el8 | All versions | 0:5.11.6.0-1.el8cf |
| `cfme-amazon-smartstate` | Red Hat:cloudforms_managementengine:5.11::el8 | All versions | 0:5.11.6.0-1.el8cf |
| `cfme-appliance` | Red Hat:cloudforms_managementengine:5.11::el8 | All versions | 0:5.11.6.0-1.el8cf |
| `cfme-appliance-common` | Red Hat:cloudforms_managementengine:5.11::el8 | All versions | 0:5.11.6.0-1.el8cf |
| `cfme-appliance-tools` | Red Hat:cloudforms_managementengine:5.11::el8 | All versions | 0:5.11.6.0-1.el8cf |
| `cfme-gemset` | Red Hat:cloudforms_managementengine:5.11::el8 | All versions | 0:5.11.6.0-1.el8cf |
| `libssh2` | Red Hat:cloudforms_managementengine:5.11::el8 | All versions | 0:1.9.0-2.el8cf |
| `libssh2-debuginfo` | Red Hat:cloudforms_managementengine:5.11::el8 | All versions | 0:1.9.0-2.el8cf |
| `libssh2-debugsource` | Red Hat:cloudforms_managementengine:5.11::el8 | All versions | 0:1.9.0-2.el8cf |
| `python3-ansible-runner` | Red Hat:cloudforms_managementengine:5.11::el8 | All versions | 0:1.4.6-1.el8ar |
| `rubygem-actionpack-4_2` | SUSE:OpenStack Cloud 7 | All versions | 4.2.9-7.9.1 |
| `rubygem-actionpack-4_2` | SUSE:OpenStack Cloud Crowbar 8 | All versions | 4.2.9-7.9.1 |
| `rubygem-actionpack-4_2` | SUSE:OpenStack Cloud Crowbar 9 | All versions | 4.2.9-7.9.1 |

Products: Fedoraproject Fedora, Opensuse Leap, Rack Rack.

## How do I fix CVE-2019-16782?

Upgrade rack to a fixed version for your release line: 1.6.12 or 2.0.8.

## Is CVE-2019-16782 being exploited?

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

## Other vulnerabilities in Fedoraproject Fedora

- [CVE-2024-4577](https://insights.sbomify.com/CVE-2024-4577/): PHP-CGI OS Command Injection (critical 9.8, exploited in the wild)
- [CVE-2021-39226](https://insights.sbomify.com/CVE-2021-39226/): Grafana Authentication Bypass (critical 9.8, exploited in the wild)
- [CVE-2019-5544](https://insights.sbomify.com/CVE-2019-5544/): VMware ESXi and Horizon DaaS OpenSLP Heap-Based Buffer Overflow (critical 9.8, exploited in the wild)
- [CVE-2024-4947](https://insights.sbomify.com/CVE-2024-4947/): Google Chromium V8 Type Confusion (critical 9.6, exploited in the wild)
- [CVE-2024-4671](https://insights.sbomify.com/CVE-2024-4671/): Google Chromium Visuals Use-After-Free (critical 9.6, exploited in the wild)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2019-16782 and fix it if it is affected.

What it is: CVE-2019-16782 is a medium-severity vulnerability in Fedoraproject Fedora, published on 18 Dec 2019. Any signed-in user can exploit it over the network, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2019-16782 in the wild and no public exploit code.

Affected packages and fixed versions:
- rack (RubyGems): affected all versions; fixed in 1.6.12
- rack (RubyGems): affected all versions; fixed in 1.6.12
- rack (RubyGems): affected from 2.0.0; fixed in 2.0.8
- rack (RubyGems): affected from 2.0.0; fixed in 2.0.8

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-2019-16782/ (Markdown: https://insights.sbomify.com/CVE-2019-16782/index.md)
```

## Sources

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

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