SecurityOnlineDo Son
Mercurial 7.2.6 Fixes Chained Flaws Enabling Code Execution
Mercurial has released version 7.2.6 to fix four chained vulnerabilities that could allow code execution on both client and server components. The Mercurial project describes 7.2.6 as a critical security release and advises all users to upgrade immediately. The issues affect every version prior to 7.2.6 and, when combined, could enable client-side or server-side arbitrary code execution, with unpatched servers potentially relaying malicious data to users.
The project notes that there have been no public exploitation reports in the wild, and it has not assigned public CVEs to these flaws at this time; Debian has already updated its trixie package to include the fixes.
The four flaws are tracked as HG-SA-2026-001 through HG-SA-2026-004 and involve: (HG-SA-2026-001) changesets with .hg/ paths or symlink writes enabling configuration injection or writes outside the working copy (all versions); (HG-SA-2026-002) a crafted bundle that poisons a cache so Mercurial uses unvalidated content (7.1 to 7.2.5); (HG-SA-2026-003) a race in symlink checks during parallel updates allowing a malicious changeset to write through a symlink (2.6 to 7.2.5); and (HG-SA-2026-004) line breaks in .hgsub URLs that inject configuration even through hg log –patch (all versions, including Windows).
Evidence from the Mercurial release notes indicates that cloning, pulling or unbundling from an untrusted source can trigger these issues, and that read-only operations on vulnerable servers could bypass validation.
Remediation includes upgrading to Mercurial 7.2.6 or applying distribution backports; additional guidance includes disabling web[.]archivesubrepos on servers and avoiding running hg inside archives of untrusted repositories created before 7.2.6, with a recommendation to apply untrusted patches via hg import rather than patch.