# CVE-2014-9462: Mercurial arbitrary command execution via crafted repository name

Source: https://junglewise.ai/threats/cve-2014-9462-mercurial-arbitrary-command-execution-via-crafted-repository-name  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2015-03-31. Updated: 2026-09-26  
License: CC BY 4.0 with a link back

CVE-2014-9462 · Severity: low · CVSS 3.1 · Published 2015-03-31

Mercurial is a distributed version control system used to manage source code repositories. A vulnerability in the SSH peer component allows attackers to execute arbitrary commands on systems when cloning a repository with a specially crafted name, potentially leading to complete system compromise without requiring authentication.

Technologies: [mercurial (PyPI)](https://junglewise.ai/threats/technologies/mercurial). Vendors: [PyPI](https://junglewise.ai/threats/vendors/pypi).

## Quick answers

**Is CVE-2014-9462 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2014-9462 being exploited in the wild.

**How severe is CVE-2014-9462?** Low severity, with a CVSS score of 3.1, published 31 March 2015.

**Which products and versions are affected?** mercurial (PyPI) ECOSYSTEM:introduced=0,fixed=3.2.4.

**Is there a fix for CVE-2014-9462?** Yes. mercurial (PyPI): upgrade to 3.2.4 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2014-9462 attacked?** It is attacked over the network.

**Am I affected by CVE-2014-9462?** Check whether you run mercurial (PyPI) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- mercurial (PyPI): upgrade to 3.2.4 or later

  ```sh
  pip install "mercurial>=3.2.4"
  ```


## Technical details

The vulnerability exists in the _validaterepo function in sshpeer, which insufficiently validates repository names passed to the clone command. An attacker can inject shell metacharacters into a repository name to execute arbitrary commands with the privileges of the user running the clone operation. The attack is network-accessible and requires no authentication or user interaction beyond initiating a clone operation. A successful exploit allows remote code execution. The vulnerability was fixed in version 3.2.4, with earlier versions (0.x through 3.2.3) affected.

## Affected products

- Mercurial Mercurial before 3.2.4

## Identifiers

- CVE-2014-9462
- GHSA-3pmw-h7j4-rf54
- PYSEC-2015-14

## Timeline

- 2015-03-31: disclosed: NVD publication date
- 2015: patched: Version 3.2.4 released with fix
- 2022-05-14: advisory: GHSA advisory published

## References

- [https://github.com/pypa/advisory-database/tree/main/vulns/mercurial/PYSEC-2015-14.yaml](https://github.com/pypa/advisory-database/tree/main/vulns/mercurial/PYSEC-2015-14.yaml)

## Related threats

- [PYSEC-2026-666 - Mercurial Directory traversal vulnerability](https://junglewise.ai/threats/cve-2008-2942-mercurial-directory-traversal-vulnerability)
- [PYSEC-2026-665 - Mercurial Improper Certificate Validation vulnerability](https://junglewise.ai/threats/cve-2010-4237-mercurial-improper-certificate-validation-vulnerability)
- [JGit Improper Input Validation vulnerability](https://junglewise.ai/threats/cve-2014-9390-jgit-improper-input-validation-vulnerability)
- [Mercurial Path Traversal/Link Following vulnerability](https://junglewise.ai/threats/cve-2019-3902-mercurial-path-traversal-link-following-vulnerability)
- [PYSEC-2018-91 - cext/manifest.c in Mercurial before 4.7.2 has an out-of-bounds read during parsing of a malformed manifest entry.](https://junglewise.ai/threats/cve-2018-17983-mercurial-out-of-bounds-read-vulnerability)
