CVE-2018-13347: mpatch.c in Mercurial before 4.6.1 mishandles integer addition and subtraction, aka OVE-20180430-0002.
Noroxi assessment
Priority: Plan (action score 40/100)
- The sources we track (CISA KEV, Exploit-DB, Metasploit, Nuclei, GitHub) show no public exploit code or exploitation in the wild.
- Probability of exploitation in the next 30 days: 2.7% (FIRST EPSS); higher than 86.2% of all records.
- Anyone who can reach it over the internet can trigger it. No account or password is required. No user action is required. No special conditions are required; it is repeatable.
- Fixed version: mercurial (Debian:12) 4.6.1-1; mercurial (Debian:8) 3.1.2-2+deb8u5; mercurial (Debian:9) 4.0-1+deb9u2.
Add it to your regular patch cycle. Upgrade to mercurial (Debian:12) 4.6.1-1; mercurial (Debian:8) 3.1.2-2+deb8u5; mercurial (Debian:9) 4.0-1+deb9u2 or later.
Generated automatically from the record's data: CVSS (NVD and CNA), CISA KEV and SSVC, FIRST EPSS, exploit sources, fixed versions. How we calculate it
Primary sources: NVD · CVE.org · FIRST EPSS
- Published
- Jul 5, 2018
- Updated
- Jun 16, 2026
- EPSS
- 2.7% · 86th percentile
- CWE
- CWE-190
Report tools
Action score
40
Add it to your regular patch cycle.
- CVSS
- 39 / 40 · 9.8 / 10
- CISA KEV
- 0 / 30 · Not listed
- EPSS
- 1 / 30 · 2.7%
Get told when this record changes
- Not in KEV: no record of exploitation in the wild
- No public exploit code on record
- A fix has been released
If any of these changes, we'll tell you in the daily email digest.
Is your version affected? Check itNoroxi analysis
What does it mean in your environment?
The assessment above is generated automatically from the record's data; it doesn't know your environment. Our team verifies on your systems whether this vulnerability is actually exploitable and which mitigation is enough.
We use this product, ask for helpAffected systems
Is your version affected?
Pick the product and type the version you run. It's compared with this record's version ranges in your browser; the version isn't sent anywhere.
| Vendor | Product | CPE |
|---|---|---|
| mercurial | mercurial | cpe:2.3:a:mercurial:mercurial |
Affected versions
NVD version ranges (for catalog products). Add the product to your stack with a version and matching uses these.
- mercurial mercurialbefore 4.6.1
Package-level exposure
OSV and GitHub Advisory data: ecosystem, package and range. SBOM matching uses this table.
| Ecosystem | Package | Affected range | Fix |
|---|---|---|---|
| Debian:12 | mercurial | before 4.6.1-1 | 4.6.1-1 |
| Debian:8 | mercurial | before 3.1.2-2+deb8u5 | 3.1.2-2+deb8u5 |
| Debian:9 | mercurial | before 4.0-1+deb9u2 | 4.0-1+deb9u2 |
| PyPI | mercurial | before 4.6.1 | 4.6.1 |
| Red Hat:enterprise_linux:7::client | emacs-mercurial | before 0:2.6.2-10.el7 | 0:2.6.2-10.el7 |
| Red Hat:enterprise_linux:7::client | emacs-mercurial-el | before 0:2.6.2-10.el7 | 0:2.6.2-10.el7 |
| Red Hat:enterprise_linux:7::client | mercurial | before 0:2.6.2-10.el7 | 0:2.6.2-10.el7 |
| Red Hat:enterprise_linux:7::client | mercurial-debuginfo | before 0:2.6.2-10.el7 | 0:2.6.2-10.el7 |
| Red Hat:enterprise_linux:7::client | mercurial-hgk | before 0:2.6.2-10.el7 | 0:2.6.2-10.el7 |
| SUSE:Linux Enterprise Module for Development Tools 15 | mercurial | before 4.5.2-3.3.1 | 4.5.2-3.3.1 |
| SUSE:Linux Enterprise Software Development Kit 11 SP4 | mercurial | before 2.3.2-0.18.9.1 | 2.3.2-0.18.9.1 |
| SUSE:Linux Enterprise Software Development Kit 12 SP3 | mercurial | before 2.8.2-15.13.1 | 2.8.2-15.13.1 |
Same product
mercurial: all recordsOther highest-scoring records for the same primary product.
- CVE-2014-9390Git before 1.8.5.6, 1.9.x before 1.9.5, 2.0.x before 2.0.5, 2.1.x before 2.1.4, and 2.2.x before 2.2.1 on Windows and OS X; Mercurial…62This week
- CVE-2017-9462In Mercurial before 4.1.3, "hg serve --stdio" allows remote authenticated users to launch the Python debugger, and consequently execute…42Plan
- CVE-2017-17458In Mercurial before 4.4.1, it is possible that a specially malformed repository can cause Git subrepositories to run arbitrary code in the…41Plan
Published before and after this one in the same product
- ← EarlierCVE-2018-1000132Mar 14, 2018 · Mercurial version 4.5 and earlier contains a Incorrect Access Control (CWE-285) vulnerability in Protocol server that can result in…37Monitor
- ← EarlierCVE-2018-13346Jul 5, 2018 · The mpatch_apply function in mpatch.c in Mercurial before 4.6.1 incorrectly proceeds in cases where the fragment start is past the end of…31Monitor
- Later →CVE-2018-13348Jul 5, 2018 · The mpatch_decode function in mpatch.c in Mercurial before 4.6.1 mishandles certain situations where there should be at least 12 bytes…31Monitor
Remediation
Which version to upgrade to
Fix versions compiled from the vendor, package registries and Microsoft. Verify the vendor's note before upgrading.
| Product / package | Fixed version | Source |
|---|---|---|
| debian:mercurial | 4.6.1-1 · Debian:12 | Package registry (OSV) |
| PyPI:mercurial | 4.6.1 | Package registry (OSV) |
| red hat:emacs-mercurial | 0:2.6.2-10.el7 · Red Hat:enterprise_linux:7::client | Package registry (OSV) |
| red hat:emacs-mercurial-el | 0:2.6.2-10.el7 · Red Hat:enterprise_linux:7::client | Package registry (OSV) |
| red hat:mercurial | 0:2.6.2-10.el7 · Red Hat:enterprise_linux:7::client | Package registry (OSV) |
| red hat:mercurial-debuginfo | 0:2.6.2-10.el7 · Red Hat:enterprise_linux:7::client | Package registry (OSV) |
| red hat:mercurial-hgk | 0:2.6.2-10.el7 · Red Hat:enterprise_linux:7::client | Package registry (OSV) |
| suse:mercurial | 2.8.2-15.13.1 · SUSE:Linux Enterprise Software Development Kit 12 SP3 | Package registry (OSV) |
Exploit status
No known public exploit
No public exploit has been observed yet. That doesn't mean you're safe, only that the bar is a little higher.
Research context
For pentesters and researchers: attack profile, score disagreement, timeline, patch commits, credits, variant and chain candidates, bug bounty scope. All derived from existing data; no exploit code.
Timeline
From publication to today: proof of concept, Metasploit module, CISA KEV and fix record. Dates are as reported by the sources.
No dated events beyond publication.
Patch and commit links
Commit, PR and diff links among the references. A starting point for patch-diffing and variant hunting; fixes, not exploits.
Not on record for this CVE: EPSS history · researcher credit · variant or chain candidate · public bounty program.
Technical details
Attack conditions
- Anyone who can reach it over the internet can trigger it.
- No account or password is required.
- No user action is required.
- No special conditions are required; it is repeatable.
If successful
- Confidentiality
- high · data can be read
- Integrity
- high · data or configuration can be modified
- Availability
- high · the service can be disrupted
- Attack vector
- Network
- Attack complexity
- Low
- Privileges required
- None
- User interaction
- None
- Scope
- Unchanged
- Confidentiality impact
- High
- Integrity impact
- High
- Availability impact
- High
Weakness class (CWE)
CWE-190 · Integer Overflow or WraparoundCVSS vector
CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
nvd-primary
Attack context
MITRE CAPEC attack patterns and ATT&CK techniques for this weakness class (CWE). A starting point for detection rules and threat hunting.
Attack patterns (CAPEC)
ATT&CK techniques
—
Change log (1)
- Fix✗ → ✓
For records you follow, these changes also arrive as notifications. →
References
Show all references (4 more)Show less
Vendor advisories and official records. Exploit/PoC links are deliberately left out.