CVE-2018-13347 json
Mercurial mishandles integer addition and subtraction
published 2018-07-06 8 y ago modified 2026-06-17 4 mo ago also GHSA-3mjj-mr4f-qxmx , PYSEC-2018-89 , EUVD-2018-0096
- cvss
- 9.8
- version 3.0, NVD
- cisa kev
- Not listed
- not in CISA's catalog
- epss
- 2.7%
- EPSS 2.7% chance of exploitation in 30 days, percentile 86%
- public exploits
- 0
- none known
Summary
mpatch.c in Mercurial before 4.6.1 mishandles integer addition and subtraction, aka OVE-20180430-0002.
Patch / fix
- pypi mercurial 4.6.1
- mercurial mercurial 4.6.1
- mercurial Debian 14, Debian 13, Debian 12 4.6.1-1
debian advisories DEBIAN-CVE-2018-13347
- mercurial Ubuntu 14.04 LTS 2.8.2-1ubuntu1.4
- mercurial Ubuntu 16.04 LTS 3.7.3-1ubuntu1.1
- mercurial Ubuntu 18.04 LTS 4.5.3-1ubuntu2.1
ubuntu advisories UBUNTU-CVE-2018-13347
Ubuntu security data © Canonical Ltd., from https://github.com/canonical/ubuntu-security-notices via OSV; changed: normalised to fixed package versions per release. CC BY-SA 4.0
- mercurial RHEL 7 2.6.2-10.el7
- mercurial-hgk RHEL 7 2.6.2-10.el7
- emacs-mercurial RHEL 7 2.6.2-10.el7
- emacs-mercurial-el RHEL 7 2.6.2-10.el7
red hat advisories RHSA-2019:2276
- mercurial SLE Software Development Kit 11 SP4 2.3.2-0.18.9.1
- mercurial SLE Software Development Kit 12 SP3 2.8.2-15.13.1
- mercurial SLE Module for Development Tools 15 4.5.2-3.3.1
suse advisories SUSE-SU-2018:1996-1SUSE-SU-2018:1990-1SUSE-SU-2018:1998-1
Vendor advisories
What the vendors themselves say about their products: affected, fixed or not affected, and what to do.
red hat product security vex CVE-2018-13347 updated cvss 7.5
mercurial: Buffer underflow in mpatch.c:mpatch_apply()
-
Red Hat Enterprise Linux 6 mercurial, mercurial-hgk, emacs-mercurial, emacs-mercurial-elaffected: no fix planned “Will not fix”
-
Red Hat Enterprise Linux Client Optional (v. 7) mercurial 2.6.2-10.el7, mercurial-hgk 2.6.2-10.el7, emacs-mercurial 2.6.2-10.el7, emacs-mercurial-el 2.6.2-10.el7 Red Hat Enterprise Linux ComputeNode Optional (v. 7) mercurial 2.6.2-10.el7, mercurial-hgk 2.6.2-10.el7, emacs-mercurial 2.6.2-10.el7, emacs-mercurial-el 2.6.2-10.el7 Red Hat Enterprise Linux Server (v. 7) mercurial 2.6.2-10.el7 Red Hat Enterprise Linux Server Optional (v. 7) mercurial-hgk 2.6.2-10.el7, emacs-mercurial 2.6.2-10.el7, emacs-mercurial-el 2.6.2-10.el7 Red Hat Enterprise Linux Workstation (v. 7) mercurial 2.6.2-10.el7 Red Hat Enterprise Linux Workstation Optional (v. 7) mercurial-hgk 2.6.2-10.el7, emacs-mercurial 2.6.2-10.el7, emacs-mercurial-el 2.6.2-10.el7fixed: vendor fix RHSA-2019:2276
-
Red Hat Enterprise Linux 8 mercurial, mercurial-chg, mercurial-hgknot affected: vulnerable code not present
Red Hat CSAF VEX © Red Hat, Inc., from https://security.access.redhat.com/data/csaf/v2/vex/; changed: reduced to product statuses and remediations. CC BY 4.0 · csaf
Exploit prediction
2.72% chance of exploitation in the next 30 days, higher than 86% of all scored CVEs (FIRST EPSS, 2026-11-08).
CVSS scores
| assigned by | version | score | vector |
|---|---|---|---|
| NVD | 3.0 | 9.8 | CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| NVD | 2.0 | 7.5 | AV:N/AC:L/Au:N/C:P/I:P/A:P |
| GitHub | 3.0 | 9.8 | CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
Affected packages
| ecosystem | package | affected | fixed in |
|---|---|---|---|
| pypi | mercurial | <4.6.1 |
4.6.1 |
Classification
- Weakness
-
- CWE-190 Integer Overflow or Wraparound
References
-
mercurial-scm.org
/repo/hg-committed/log?rev=modifies%28%22mercurial%2Fmpatch.c%22%29+and+4.5%3A%3A
web, patch, vendor-advisory
-
mercurial-scm.org
/repo/hg/rev/1acfc35d478c
web, patch, vendor-advisory
-
access.redhat.com
/errata/RHSA-2019:2276
vendor-advisory, web, advisory
-
mercurial-scm.org
/wiki/WhatsNew#Mercurial_4.6.1_.282018-06-06.29
web, release-notes, vendor-advisory
-
lists.debian.org
/debian-lts-announce/2020/07/msg00032.html
mailing-list, web
-
nvd.nist.gov
/vuln/detail/CVE-2018-13347
advisory
-
github.com
/pypa/advisory-database/tree/main/vulns/mercurial/PYSEC-2018-89.yaml
web
-
github.com
/advisories/GHSA-3mjj-mr4f-qxmx
advisory
Sources
- CVE List CVE-2018-13347
- GitHub Advisory GHSA-3mjj-mr4f-qxmx
- NVD CVE-2018-13347
- OSV PYSEC-2018-89
Fencer Vulns keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.