Vulnerabilities In Mercurial That Could Lead To Code Execution On Server And Client Sides

Published corrective release of distributed version control system Mercurial 7.2.6, which eliminates 4 vulnerabilities (CVEs not assigned) that can lead to remote code execution on the server or client side when processing specially designed repositories or bundle files. The client system can be compromised by cloning, pulling, unpacking, or applying patches from unverified sources, or by executing “hg archive”, “hg cat” or “hg diff” commands on revisions obtained from unverified sources. The server can be attacked if the attacker can execute push requests.

Fixed vulnerabilities:

  • HG-SA-2026-001 – allows you to execute arbitrary code or write files outside the working directory through commits containing the “.hg/” directory or symbolic links. The problem occurs when performing operations like “hg archive”.
  • HG-SA-2026-002 – Bypass integrity check via cache poisoning. The vulnerability occurs when processing a specially crafted bundle file using commands such as “hg clone” and “hg pull -u”.
  • HG-SA-2026-003 – Race condition when checking symbolic links in concurrent worker processes. The vulnerability can be exploited when transferring a specially designed set of changes.
  • HG-SA-2026-004 – allows you to implement settings through a corrupted .hgsub file, using line break substitution in the URLs of subrepositories. The attack can be carried out even by executing simple commands such as “hg log –patch”.
/Reports, release notes, official announcements.