Mercurial 7.2.6 fixes flaws that can run attacker code on clients and servers
Four advisories cover archive and symlink writes, a bundle integrity bypass, a parallel-update race, and configuration injection via subrepository URLs.
Mercurial 7.2.6 closes several high-impact flaws that, combined, let an attacker run arbitrary code on clients and on servers that accept pushes from untrusted users. Raphaël Gomès announced the release on the oss-security list, warning that the issues can be chained and that unpatched servers can also pass malicious data on to their users.
Exposure is not limited to a full checkout of a hostile tree. Clients are at risk if they clone, pull, unbundle, or apply patches from a source they do not fully trust, or if they run ordinary commands such as archive, cat, or diff against revisions from such a source. On the server side, validation that was meant to reject bad content could be bypassed, and operations that look read-only could still execute code.
The project assigned four identifiers. HG-SA-2026-001, present in all versions, let changesets containing paths under Mercurial's own metadata directory, or writes through symlinks, be exported and exchanged, which could inject configuration or write outside the working copy. HG-SA-2026-002, affecting 7.1 through 7.2.5, let a crafted bundle poison a cache so the same process used content that had not been validated, including during clone or an updating pull. HG-SA-2026-003, from 2.6 through 7.2.5, is a race in symlink checks used by parallel update workers that a malicious changeset could exploit reliably. HG-SA-2026-004, all versions including Windows, let line breaks in a subrepository URL inject configuration into repositories created in the background, from operations as simple as viewing a patch log, without checking anything out.
No new upstream releases are planned for older series. Backported patches are available to distributions on request. Gomès wrote that Mercurial has "extremely rarely broken backwards compatibility, so upgrading should be painless."