# CVE-2013-0334: Bundler may install gems from a different source than expected

> Attackers can install malicious gems by exploiting multiple source configurations in Bundler, leading to arbitrary code execution.

- **Severity:** Medium 5.0 (`AV:N/AC:L/Au:N/C:N/I:P/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 31 Oct 2014
- **Updated:** 6 Aug 2024
- **Also known as:** GHSA-49jx-9cmc-xjxm, RHSA-2015:2180, SUSE-SU-2015:0795-1

## What is CVE-2013-0334?

CVE-2013-0334 is a medium-severity vulnerability in Fedoraproject Fedora, published on 31 Oct 2014. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

Bundler before 1.7, when multiple top-level source lines are used, allows remote attackers to install arbitrary gems by creating a gem with the same name as another gem in a different source.

Weakness: CWE-20 (Improper Input Validation)

## Which versions are affected by CVE-2013-0334?

2 open source packages ship an affected version, including bundler. It affects 3 products.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `bundler` | RubyGems | All versions | 1.7.0 |
| `bundler` | RubyGems | All versions | 1.7.0 |
| `rubygem-bundler` | Red Hat:enterprise_linux:7::client | All versions | 0:1.7.8-3.el7 |
| `rubygem-bundler-doc` | Red Hat:enterprise_linux:7::client | All versions | 0:1.7.8-3.el7 |
| `rubygem-thor` | Red Hat:enterprise_linux:7::client | All versions | 0:0.19.1-1.el7 |
| `rubygem-thor-doc` | Red Hat:enterprise_linux:7::client | All versions | 0:0.19.1-1.el7 |
| `rubygem-bundler` | Red Hat:enterprise_linux:7::computenode | All versions | 0:1.7.8-3.el7 |
| `rubygem-bundler-doc` | Red Hat:enterprise_linux:7::computenode | All versions | 0:1.7.8-3.el7 |
| `rubygem-thor` | Red Hat:enterprise_linux:7::computenode | All versions | 0:0.19.1-1.el7 |
| `rubygem-thor-doc` | Red Hat:enterprise_linux:7::computenode | All versions | 0:0.19.1-1.el7 |
| `rubygem-bundler` | Red Hat:enterprise_linux:7::server | All versions | 0:1.7.8-3.el7 |
| `rubygem-bundler-doc` | Red Hat:enterprise_linux:7::server | All versions | 0:1.7.8-3.el7 |
| `rubygem-thor` | Red Hat:enterprise_linux:7::server | All versions | 0:0.19.1-1.el7 |
| `rubygem-thor-doc` | Red Hat:enterprise_linux:7::server | All versions | 0:0.19.1-1.el7 |
| `rubygem-bundler` | Red Hat:enterprise_linux:7::workstation | All versions | 0:1.7.8-3.el7 |
| `rubygem-bundler-doc` | Red Hat:enterprise_linux:7::workstation | All versions | 0:1.7.8-3.el7 |
| `rubygem-thor` | Red Hat:enterprise_linux:7::workstation | All versions | 0:0.19.1-1.el7 |
| `rubygem-thor-doc` | Red Hat:enterprise_linux:7::workstation | All versions | 0:0.19.1-1.el7 |

Products: Bundler Bundler, Fedoraproject Fedora, Opensuse Opensuse.

## How do I fix CVE-2013-0334?

Upgrade bundler to 1.7.0 or later.

## Is CVE-2013-0334 being exploited?

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

## Other vulnerabilities in Fedoraproject Fedora

- [CVE-2016-7954](https://insights.sbomify.com/CVE-2016-7954/): Bundler allows attacker to inject arbitrary code via secondary Gem source (critical 9.8)
- [CVE-2020-36327](https://insights.sbomify.com/CVE-2020-36327/): Dependency Confusion in Bundler (high 8.8)
- [CVE-2019-3881](https://insights.sbomify.com/CVE-2019-3881/): Insecure path handling in Bundler (high 7.8)
- [CVE-2021-43809](https://insights.sbomify.com/CVE-2021-43809/): Local Code Execution through Argument Injection via dash leading git url parameter in Gemfile (medium 6.7)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2013-0334 and fix it if it is affected.

What it is: CVE-2013-0334 is a medium-severity vulnerability in Fedoraproject Fedora, published on 31 Oct 2014. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2013-0334 in the wild and no public exploit code.

Affected packages and fixed versions:
- bundler (RubyGems): affected all versions; fixed in 1.7.0
- bundler (RubyGems): affected all versions; fixed in 1.7.0

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

## Sources

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

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