Description
In Mercurial before 4.4.1, it is possible that a specially malformed repository can cause Git subrepositories to run arbitrary code in the form of a .git/hooks/post-update script checked into the repository. Typical use of Mercurial prevents construction of such repositories, but they can be created programmatically.
Fixed in Linux distributions
Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.
Debian
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian 14 | mercurial | 4.4.1-1 | — |
| Debian 13 | mercurial | 4.4.1-1 | — |
| Debian 12 | mercurial | 4.4.1-1 | — |
| Debian 9 | mercurial | 4.0-1+deb9u2 | DLA-2293-1 |
| Debian 8 | mercurial | 3.1.2-2+deb8u5 | DLA-1414-2, DLA-1414-1 |
Show 1 more (older releases, extended support, other products)Fewer releases
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian 7 | mercurial | 2.2.2-4+deb7u6 | DLA-1224-1 |
Ubuntu
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu 16.04 LTS | mercurial | 3.7.3-1ubuntu1.1 | — |
| Ubuntu 14.04 LTS | mercurial | 2.8.2-1ubuntu1.4 | — |
SUSE
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| SLES 12 SP3 | mercurial | 2.8.2-15.6.1 | SUSE-SU-2018:0129-1 |
| SLES 12 SP2 | mercurial | 2.8.2-15.6.1 | SUSE-SU-2018:0129-1 |
| SLES 11 SP4 | mercurial | 2.3.2-0.18.6.1 | SUSE-SU-2018:0127-1 |
openSUSE
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| openSUSE Tumbleweed | mercurial | 5.9.1-2.1 | openSUSE-SU-2024:10586-1 |
Affected packages
| Ecosystem | Package | Affected | Fixed | Record |
|---|---|---|---|---|
| PyPI | mercurial | < 4.4.1 | 4.4.1 | GHSA-6v56-cpg6-3rpx |
Advisories 7
- DLA-2293-1 mercurial - security update Debian Security (DSA / DLA) · Mar 9, 2026
- DLA-1224-1 mercurial - security update Debian Security (DSA / DLA) · Mar 9, 2026
- DLA-1414-1 mercurial - security update Debian Security (DSA / DLA) · Mar 9, 2026
- DLA-1414-2 mercurial - regression update Debian Security (DSA / DLA) · Mar 9, 2026
- SUSE-SU-2018:0127-1 Security update for mercurial SUSE / openSUSE Security Updates · Feb 4, 2026
- openSUSE-SU-2024:10586-1 mercurial-5.9.1-2.1 on GA media SUSE / openSUSE Security Updates · Feb 4, 2026
- SUSE-SU-2018:0129-1 Security update for mercurial SUSE / openSUSE Security Updates · Feb 4, 2026
References
- [debian-lts-announce] 20171228 [SECURITY] [DLA 1224-1] mercurial security update mailing-list
- https://www.mercurial-scm.org/wiki/WhatsNew#Mercurial_4.4.1_.282017-11-07.29
- [debian-lts-announce] 20180727 [SECURITY] [DLA 1414-2] mercurial regression update mailing-list
- [debian-lts-announce] 20180705 [SECURITY] [DLA 1414-1] mercurial security update mailing-list
- https://www.mercurial-scm.org/pipermail/mercurial-devel/2017-November/107333.html
- 102926 vdb-entry
- https://bz.mercurial-scm.org/show_bug.cgi?id=5730
- https://confluence.atlassian.com/sourcetreekb/sourcetree-security-advisory-2018-01-24-942834324.html
- [debian-lts-announce] 20200731 [SECURITY] [DLA 2293-1] mercurial security update mailing-list