CVE-2018-13347: Mercurial mishandles integer addition and subtraction
9.8
CVSS Score
3.0
Basic Information
CVE ID
GHSA ID
EPSS Score
0.61749%
CWE
Published
5/13/2022
Updated
9/25/2024
KEV Status
No
Technology
Python
Technical Details
CVSS Vector
CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
---|---|---|---|
mercurial | pip | < 4.6.1 | 4.6.1 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The security patch adds mpatch_apply()
in mpatch.c
. The original vulnerability (CWE-190) occurred when handling fragment positions in binary patches. The added checks for negative 'last' values (f->start < last || f->end > len || last < 0) and post-loop validation directly address integer wrapping/underflow scenarios. As this is the core patch application function that processes untrusted delta patches, it would appear in stack traces during exploitation attempts involving maliciously crafted patches.