# A flaw was found in Mercurial before 4.9. It was possible to use symlinks and subrepositories to defeat Mercurial's path-checking logic and write files outside a repository.

Advisory record · `GHSA-mq66-vcfc-8246`

- **Identifiers:** `GHSA-mq66-vcfc-8246` · `CVE-2019-3902` · `PYSEC-2019-188`
- **State:** Confirmed
- **Severity:** CVSS 5.1 Medium
- **Critical:** No
- **Weakness (CWE):** [CWE-22](https://cwe.mitre.org/data/definitions/22.html)
- **Tags:** [Path traversal](https://agentprime.io/advisories/tag/path-traversal.md)
- **Published:** 22 Apr 2019
- **Updated:** 10 Jun 2026
- **Reviewed by a person:** No

Published by the GitHub Advisory Database at 22 Apr 2019, 16:29 UTC. agentprime has not analysed this yet, so whether it affects any app is not known.

## Affected packages

- `mercurial` (PyPI): affected `<4.9`; fixed in `4.9`

## Machine-written summary

Summary written by Claude Haiku from the source advisory. Not reviewed by a person.

> Mercurial versions before 4.9 are vulnerable. A crafted repository that uses symlinks and subrepositories can defeat Mercurial's path checks and write files outside the repository, so an attacker would need to supply a repository for the user to work with. The fix is to upgrade mercurial to version 4.9 or later. The source gives few details on the exact trigger.

Written 9 Nov 2026.

## Not analysed yet

We haven’t published our analysis of this Advisory yet. Once a person has reviewed it, this page will say what’s vulnerable, what has to be true for your app to be affected, and how to check.

## Severity and exploitation

- 5.1 Medium, CVSS 3.0: `CVSS:3.0/AV:L/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N`, from CNA (redhat)

- **CISA KEV:** Not listed.
- **EPSS:** 0.014, the 72nd percentile, on 21 Nov 2026: FIRST’s estimate of the chance of exploitation in the next 30 days.

## Timeline

This record came from the full history of the GitHub Advisory Database, published 22 Apr 2019. New records show when each source confirmed them.

## Sources

- [GitHub Advisory Database: GHSA-mq66-vcfc-8246](https://github.com/advisories/GHSA-mq66-vcfc-8246)
- [OSV: GHSA-mq66-vcfc-8246](https://osv.dev/vulnerability/GHSA-mq66-vcfc-8246)
- <https://lists.debian.org/debian-lts-announce/2019/04/msg00024.html>
- <https://www.mercurial-scm.org/wiki/WhatsNew#Mercurial_4.9_.282019-02-01.29>
- <https://usn.ubuntu.com/4086-1/>
- <https://lists.debian.org/debian-lts-announce/2020/07/msg00032.html>
- <https://github.com/advisories/GHSA-mq66-vcfc-8246>

Facts on this page come from the GitHub Advisory Database (CC-BY 4.0), OSV and the other sources listed, as published. We don’t reproduce full advisory descriptions, which can contain exploit code.

## Check whether this affects you

A Match means an installed version is in the affected range above. Most don’t affect the app; agentprime hasn’t analysed this one yet.

- With the agentprime MCP server (<https://api.agentprime.io/mcp>), ask your agent to check the project: `check_lockfile` sends a lockfile, `check_packages` a list of installed packages, and both return the Matches and the upgrades that clear them. `get_advisory` returns this record. Setup: <https://agentprime.io/mcp.md>
- In a browser: <https://agentprime.io/check/> reads your lockfile in the browser, never uploading it.
- Whether it touches your code, with file and line: the Claude Code plugin, <https://agentprime.io/plugin.md>
- As JSON: <https://api.agentprime.io/v1/advisories/GHSA-mq66-vcfc-8246>, or `POST https://api.agentprime.io/v1/match` with your packages (<https://agentprime.io/api.md>)

---

The web page: <https://agentprime.io/advisories/GHSA-mq66-vcfc-8246/>. Everything for agents: <https://agentprime.io/llms.txt>.
