CWE-190
AllowedInteger Overflow or Wraparound
Abstraction: Base · Status: Stable
The product performs a calculation that can produce an integer overflow or wraparound when the logic assumes that the resulting value will always be larger than the original value. This occurs when an integer value is incremented to a value that is too large to store in the associated representation. When this occurs, the value may become a very small or negative number.
3899 vulnerabilities reference this CWE, most recent first.
GHSA-G552-HXVR-6RPV
Vulnerability from github – Published: 2024-10-23 00:31 – Updated: 2024-10-23 21:30Integer Overflow in fast_ping.c in SmartDNS Release46 allows remote attackers to cause a Denial of Service via misaligned memory access.
{
"affected": [],
"aliases": [
"CVE-2024-42643"
],
"database_specific": {
"cwe_ids": [
"CWE-190"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2024-10-22T22:15:04Z",
"severity": "HIGH"
},
"details": "Integer Overflow in fast_ping.c in SmartDNS Release46 allows remote attackers to cause a Denial of Service via misaligned memory access.",
"id": "GHSA-g552-hxvr-6rpv",
"modified": "2024-10-23T21:30:28Z",
"published": "2024-10-23T00:31:44Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2024-42643"
},
{
"type": "WEB",
"url": "https://github.com/pymumu/smartdns/issues/1779"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H",
"type": "CVSS_V3"
}
]
}
GHSA-G559-RF7H-66VC
Vulnerability from github – Published: 2022-05-01 07:19 – Updated: 2022-05-01 07:19Multiple integer overflows in the image loader plug-ins in GIMP before 2.2.16 allow user-assisted remote attackers to execute arbitrary code via crafted length values in (1) DICOM, (2) PNM, (3) PSD, (4) PSP, (5) Sun RAS, (6) XBM, and (7) XWD files.
{
"affected": [],
"aliases": [
"CVE-2006-4519"
],
"database_specific": {
"cwe_ids": [
"CWE-190"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2007-07-10T18:30:00Z",
"severity": "MODERATE"
},
"details": "Multiple integer overflows in the image loader plug-ins in GIMP before 2.2.16 allow user-assisted remote attackers to execute arbitrary code via crafted length values in (1) DICOM, (2) PNM, (3) PSD, (4) PSP, (5) Sun RAS, (6) XBM, and (7) XWD files.",
"id": "GHSA-g559-rf7h-66vc",
"modified": "2022-05-01T07:19:23Z",
"published": "2022-05-01T07:19:23Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2006-4519"
},
{
"type": "WEB",
"url": "https://exchange.xforce.ibmcloud.com/vulnerabilities/35308"
},
{
"type": "WEB",
"url": "https://oval.cisecurity.org/repository/search/definition/oval%3Aorg.mitre.oval%3Adef%3A10842"
},
{
"type": "WEB",
"url": "http://bugzilla.gnome.org/show_bug.cgi?id=451379"
},
{
"type": "WEB",
"url": "http://developer.gimp.org/NEWS-2.2"
},
{
"type": "WEB",
"url": "http://issues.foresightlinux.org/browse/FL-457"
},
{
"type": "WEB",
"url": "http://labs.idefense.com/intelligence/vulnerabilities/display.php?id=551"
},
{
"type": "WEB",
"url": "http://osvdb.org/42139"
},
{
"type": "WEB",
"url": "http://osvdb.org/42140"
},
{
"type": "WEB",
"url": "http://osvdb.org/42141"
},
{
"type": "WEB",
"url": "http://osvdb.org/42142"
},
{
"type": "WEB",
"url": "http://osvdb.org/42143"
},
{
"type": "WEB",
"url": "http://osvdb.org/42144"
},
{
"type": "WEB",
"url": "http://osvdb.org/42145"
},
{
"type": "WEB",
"url": "http://secunia.com/advisories/26132"
},
{
"type": "WEB",
"url": "http://secunia.com/advisories/26215"
},
{
"type": "WEB",
"url": "http://secunia.com/advisories/26240"
},
{
"type": "WEB",
"url": "http://secunia.com/advisories/26575"
},
{
"type": "WEB",
"url": "http://secunia.com/advisories/26939"
},
{
"type": "WEB",
"url": "http://security.gentoo.org/glsa/glsa-200707-09.xml"
},
{
"type": "WEB",
"url": "http://www.debian.org/security/2007/dsa-1335"
},
{
"type": "WEB",
"url": "http://www.mandriva.com/security/advisories?name=MDKSA-2007:170"
},
{
"type": "WEB",
"url": "http://www.redhat.com/support/errata/RHSA-2007-0513.html"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/archive/1/475257/100/0/threaded"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/bid/24835"
},
{
"type": "WEB",
"url": "http://www.securitytracker.com/id?1018349"
},
{
"type": "WEB",
"url": "http://www.ubuntu.com/usn/usn-494-1"
},
{
"type": "WEB",
"url": "http://www.vupen.com/english/advisories/2007/2471"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-G567-H7P8-Q9Q9
Vulnerability from github – Published: 2022-05-14 02:12 – Updated: 2022-05-14 02:12Integer overflow in the str_pad function in ext/standard/string.c in PHP before 7.0.4 allows remote attackers to cause a denial of service or possibly have unspecified other impact via a long string, leading to a heap-based buffer overflow.
{
"affected": [],
"aliases": [
"CVE-2016-4346"
],
"database_specific": {
"cwe_ids": [
"CWE-190"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2016-05-22T01:59:00Z",
"severity": "CRITICAL"
},
"details": "Integer overflow in the str_pad function in ext/standard/string.c in PHP before 7.0.4 allows remote attackers to cause a denial of service or possibly have unspecified other impact via a long string, leading to a heap-based buffer overflow.",
"id": "GHSA-g567-h7p8-q9q9",
"modified": "2022-05-14T02:12:13Z",
"published": "2022-05-14T02:12:13Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2016-4346"
},
{
"type": "WEB",
"url": "https://bugs.php.net/bug.php?id=71637"
},
{
"type": "WEB",
"url": "http://lists.opensuse.org/opensuse-updates/2016-05/msg00086.html"
},
{
"type": "WEB",
"url": "http://lists.opensuse.org/opensuse-updates/2016-06/msg00027.html"
},
{
"type": "WEB",
"url": "http://php.net/ChangeLog-7.php"
},
{
"type": "WEB",
"url": "http://www.openwall.com/lists/oss-security/2016/04/28/2"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H",
"type": "CVSS_V3"
}
]
}
GHSA-G589-Q56X-4RHP
Vulnerability from github – Published: 2022-05-01 18:42 – Updated: 2022-05-01 18:42Integer overflow in exif.cpp in exiv2 library allows context-dependent attackers to execute arbitrary code via a crafted EXIF file that triggers a heap-based buffer overflow.
{
"affected": [],
"aliases": [
"CVE-2007-6353"
],
"database_specific": {
"cwe_ids": [
"CWE-190"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2007-12-20T01:46:00Z",
"severity": "HIGH"
},
"details": "Integer overflow in exif.cpp in exiv2 library allows context-dependent attackers to execute arbitrary code via a crafted EXIF file that triggers a heap-based buffer overflow.",
"id": "GHSA-g589-q56x-4rhp",
"modified": "2022-05-01T18:42:04Z",
"published": "2022-05-01T18:42:04Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2007-6353"
},
{
"type": "WEB",
"url": "https://bugzilla.redhat.com/show_bug.cgi?id=425921"
},
{
"type": "WEB",
"url": "https://exchange.xforce.ibmcloud.com/vulnerabilities/39118"
},
{
"type": "WEB",
"url": "https://www.redhat.com/archives/fedora-package-announce/2007-December/msg00652.html"
},
{
"type": "WEB",
"url": "https://www.redhat.com/archives/fedora-package-announce/2007-December/msg00674.html"
},
{
"type": "WEB",
"url": "http://bugs.gentoo.org/show_bug.cgi?id=202351"
},
{
"type": "WEB",
"url": "http://lists.opensuse.org/opensuse-security-announce/2008-01/msg00002.html"
},
{
"type": "WEB",
"url": "http://secunia.com/advisories/28132"
},
{
"type": "WEB",
"url": "http://secunia.com/advisories/28178"
},
{
"type": "WEB",
"url": "http://secunia.com/advisories/28267"
},
{
"type": "WEB",
"url": "http://secunia.com/advisories/28412"
},
{
"type": "WEB",
"url": "http://secunia.com/advisories/28610"
},
{
"type": "WEB",
"url": "http://secunia.com/advisories/32273"
},
{
"type": "WEB",
"url": "http://security.gentoo.org/glsa/glsa-200712-16.xml"
},
{
"type": "WEB",
"url": "http://www.debian.org/security/2008/dsa-1474"
},
{
"type": "WEB",
"url": "http://www.mandriva.com/security/advisories?name=MDVSA-2008:006"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/bid/26918"
},
{
"type": "WEB",
"url": "http://www.ubuntu.com/usn/usn-655-1"
},
{
"type": "WEB",
"url": "http://www.vupen.com/english/advisories/2007/4252"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-G58R-622Q-XQ3R
Vulnerability from github – Published: 2022-05-14 03:05 – Updated: 2022-05-14 03:05The sell function of a smart contract implementation for ENTER (ENTR) (Contract Name: EnterToken), an Ethereum token, has an integer overflow in which "amount * sellPrice" can be zero, consequently reducing a seller's assets.
{
"affected": [],
"aliases": [
"CVE-2018-13231"
],
"database_specific": {
"cwe_ids": [
"CWE-190"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2018-07-05T02:29:00Z",
"severity": "HIGH"
},
"details": "The sell function of a smart contract implementation for ENTER (ENTR) (Contract Name: EnterToken), an Ethereum token, has an integer overflow in which \"amount * sellPrice\" can be zero, consequently reducing a seller\u0027s assets.",
"id": "GHSA-g58r-622q-xq3r",
"modified": "2022-05-14T03:05:35Z",
"published": "2022-05-14T03:05:35Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2018-13231"
},
{
"type": "WEB",
"url": "https://github.com/BlockChainsSecurity/EtherTokens/blob/master/ETHEREUMBLACK/sell%20integer%20overflow.md"
},
{
"type": "WEB",
"url": "https://github.com/BlockChainsSecurity/EtherTokens/tree/master/EnterToken"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N",
"type": "CVSS_V3"
}
]
}
GHSA-G5FF-82HW-J5F8
Vulnerability from github – Published: 2022-05-01 17:42 – Updated: 2022-05-01 17:42Integer overflow in the IMAP (IMAP4) support in Microsoft Exchange Server 2000 SP3 allows remote attackers to cause a denial of service (service hang) via crafted literals in an IMAP command, aka the "IMAP Literal Processing Vulnerability."
{
"affected": [],
"aliases": [
"CVE-2007-0221"
],
"database_specific": {
"cwe_ids": [
"CWE-190"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2007-05-08T23:19:00Z",
"severity": "HIGH"
},
"details": "Integer overflow in the IMAP (IMAP4) support in Microsoft Exchange Server 2000 SP3 allows remote attackers to cause a denial of service (service hang) via crafted literals in an IMAP command, aka the \"IMAP Literal Processing Vulnerability.\"",
"id": "GHSA-g5ff-82hw-j5f8",
"modified": "2022-05-01T17:42:32Z",
"published": "2022-05-01T17:42:32Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2007-0221"
},
{
"type": "WEB",
"url": "https://docs.microsoft.com/en-us/security-updates/securitybulletins/2007/ms07-026"
},
{
"type": "WEB",
"url": "https://exchange.xforce.ibmcloud.com/vulnerabilities/33890"
},
{
"type": "WEB",
"url": "https://oval.cisecurity.org/repository/search/definition/oval%3Aorg.mitre.oval%3Adef%3A2054"
},
{
"type": "WEB",
"url": "http://labs.idefense.com/intelligence/vulnerabilities/display.php?id=526"
},
{
"type": "WEB",
"url": "http://secunia.com/advisories/25183"
},
{
"type": "WEB",
"url": "http://www.osvdb.org/34392"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/archive/1/468871/100/200/threaded"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/bid/23810"
},
{
"type": "WEB",
"url": "http://www.securitytracker.com/id?1018015"
},
{
"type": "WEB",
"url": "http://www.us-cert.gov/cas/techalerts/TA07-128A.html"
},
{
"type": "WEB",
"url": "http://www.vupen.com/english/advisories/2007/1711"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-G5HH-6MQM-F64R
Vulnerability from github – Published: 2022-05-13 01:01 – Updated: 2022-05-13 01:01An exploitable integer overflow exists in the IRIS loading functionality of the Blender open-source 3d creation suite version 2.78c. A specially crafted '.iris' file can cause an integer overflow resulting in a buffer overflow which can allow for code execution under the context of the application. An attacker can convince a user to use the file as an asset via the sequencer in order to trigger this vulnerability.
{
"affected": [],
"aliases": [
"CVE-2017-2901"
],
"database_specific": {
"cwe_ids": [
"CWE-190"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2018-04-24T19:29:00Z",
"severity": "HIGH"
},
"details": "An exploitable integer overflow exists in the IRIS loading functionality of the Blender open-source 3d creation suite version 2.78c. A specially crafted \u0027.iris\u0027 file can cause an integer overflow resulting in a buffer overflow which can allow for code execution under the context of the application. An attacker can convince a user to use the file as an asset via the sequencer in order to trigger this vulnerability.",
"id": "GHSA-g5hh-6mqm-f64r",
"modified": "2022-05-13T01:01:14Z",
"published": "2022-05-13T01:01:14Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2017-2901"
},
{
"type": "WEB",
"url": "https://lists.debian.org/debian-lts-announce/2018/08/msg00011.html"
},
{
"type": "WEB",
"url": "https://www.debian.org/security/2018/dsa-4248"
},
{
"type": "WEB",
"url": "https://www.talosintelligence.com/vulnerability_reports/TALOS-2017-0408"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.0/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H",
"type": "CVSS_V3"
}
]
}
GHSA-G5QC-P7W9-V26C
Vulnerability from github – Published: 2025-03-27 18:31 – Updated: 2025-10-31 21:30In the Linux kernel, the following vulnerability has been resolved:
netfilter: ipset: Fix overflow before widen in the bitmap_ip_create() function.
When first_ip is 0, last_ip is 0xFFFFFFFF, and netmask is 31, the value of an arithmetic expression 2 << (netmask - mask_bits - 1) is subject to overflow due to a failure casting operands to a larger data type before performing the arithmetic.
Note that it's harmless since the value will be checked at the next step.
Found by InfoTeCS on behalf of Linux Verification Center (linuxtesting.org) with SVACE.
{
"affected": [],
"aliases": [
"CVE-2023-53032"
],
"database_specific": {
"cwe_ids": [
"CWE-190"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2025-03-27T17:15:52Z",
"severity": "MODERATE"
},
"details": "In the Linux kernel, the following vulnerability has been resolved:\n\nnetfilter: ipset: Fix overflow before widen in the bitmap_ip_create() function.\n\nWhen first_ip is 0, last_ip is 0xFFFFFFFF, and netmask is 31, the value of\nan arithmetic expression 2 \u003c\u003c (netmask - mask_bits - 1) is subject\nto overflow due to a failure casting operands to a larger data type\nbefore performing the arithmetic.\n\nNote that it\u0027s harmless since the value will be checked at the next step.\n\nFound by InfoTeCS on behalf of Linux Verification Center\n(linuxtesting.org) with SVACE.",
"id": "GHSA-g5qc-p7w9-v26c",
"modified": "2025-10-31T21:30:52Z",
"published": "2025-03-27T18:31:29Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2023-53032"
},
{
"type": "WEB",
"url": "https://git.kernel.org/stable/c/4e6a70fd840400e3a2e784a6673968a3eb2431c0"
},
{
"type": "WEB",
"url": "https://git.kernel.org/stable/c/511cf17b2447fc41cfef8d71936e1fa53e395c1e"
},
{
"type": "WEB",
"url": "https://git.kernel.org/stable/c/9ea4b476cea1b7d461d16dda25ca3c7e616e2d15"
},
{
"type": "WEB",
"url": "https://git.kernel.org/stable/c/dfd834ccc1b88bbbab81b9046a3a539dd0c2d14f"
},
{
"type": "WEB",
"url": "https://git.kernel.org/stable/c/e137d9bb26bd85ce07323a38e38ceb0b160db841"
},
{
"type": "WEB",
"url": "https://git.kernel.org/stable/c/e88865876d47c790be0d5e23973499d75d034364"
},
{
"type": "WEB",
"url": "https://git.kernel.org/stable/c/feefb33eefa166fc3e0fd17547b0bc0cb3baced9"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H",
"type": "CVSS_V3"
}
]
}
GHSA-G654-6PP3-8M8W
Vulnerability from github – Published: 2022-02-10 00:01 – Updated: 2022-06-15 00:00build_model in xmlparse.c in Expat (aka libexpat) before 2.4.3 has an integer overflow.
{
"affected": [],
"aliases": [
"CVE-2022-22823"
],
"database_specific": {
"cwe_ids": [
"CWE-190"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2022-01-10T14:12:00Z",
"severity": "CRITICAL"
},
"details": "build_model in xmlparse.c in Expat (aka libexpat) before 2.4.3 has an integer overflow.",
"id": "GHSA-g654-6pp3-8m8w",
"modified": "2022-06-15T00:00:29Z",
"published": "2022-02-10T00:01:19Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2022-22823"
},
{
"type": "WEB",
"url": "https://github.com/libexpat/libexpat/pull/539"
},
{
"type": "WEB",
"url": "https://cert-portal.siemens.com/productcert/pdf/ssa-484086.pdf"
},
{
"type": "WEB",
"url": "https://security.gentoo.org/glsa/202209-24"
},
{
"type": "WEB",
"url": "https://www.debian.org/security/2022/dsa-5073"
},
{
"type": "WEB",
"url": "https://www.tenable.com/security/tns-2022-05"
},
{
"type": "WEB",
"url": "http://www.openwall.com/lists/oss-security/2022/01/17/3"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H",
"type": "CVSS_V3"
}
]
}
GHSA-G6CQ-58WQ-V493
Vulnerability from github – Published: 2022-05-24 17:24 – Updated: 2022-11-29 03:30An integer overflow leading to a heap-buffer overflow was found in The X Input Method (XIM) client was implemented in libX11 before version 1.6.10. As per upstream this is security relevant when setuid programs call XIM client functions while running with elevated privileges. No such programs are shipped with Red Hat Enterprise Linux.
{
"affected": [],
"aliases": [
"CVE-2020-14344"
],
"database_specific": {
"cwe_ids": [
"CWE-190"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2020-08-05T14:15:00Z",
"severity": "MODERATE"
},
"details": "An integer overflow leading to a heap-buffer overflow was found in The X Input Method (XIM) client was implemented in libX11 before version 1.6.10. As per upstream this is security relevant when setuid programs call XIM client functions while running with elevated privileges. No such programs are shipped with Red Hat Enterprise Linux.",
"id": "GHSA-g6cq-58wq-v493",
"modified": "2022-11-29T03:30:25Z",
"published": "2022-05-24T17:24:58Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2020-14344"
},
{
"type": "WEB",
"url": "https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2020-14344"
},
{
"type": "WEB",
"url": "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/4VDDSAYV7XGNRCXE7HCU23645MG74OFF"
},
{
"type": "WEB",
"url": "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/7AVXCQOSCAPKYYHFIJAZ6E2C7LJBTLXF"
},
{
"type": "WEB",
"url": "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/XY4H2SIEF2362AMNX5ZKWAELGU7LKFJB"
},
{
"type": "WEB",
"url": "https://lists.x.org/archives/xorg-announce/2020-July/003050.html"
},
{
"type": "WEB",
"url": "https://security.gentoo.org/glsa/202008-18"
},
{
"type": "WEB",
"url": "https://usn.ubuntu.com/4487-1"
},
{
"type": "WEB",
"url": "https://usn.ubuntu.com/4487-2"
},
{
"type": "WEB",
"url": "https://www.openwall.com/lists/oss-security/2020/07/31/1"
},
{
"type": "WEB",
"url": "http://lists.opensuse.org/opensuse-security-announce/2020-08/msg00014.html"
},
{
"type": "WEB",
"url": "http://lists.opensuse.org/opensuse-security-announce/2020-08/msg00015.html"
},
{
"type": "WEB",
"url": "http://lists.opensuse.org/opensuse-security-announce/2020-08/msg00024.html"
},
{
"type": "WEB",
"url": "http://lists.opensuse.org/opensuse-security-announce/2020-08/msg00031.html"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:L/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H",
"type": "CVSS_V3"
}
]
}
Mitigation
Ensure that all protocols are strictly defined, such that all out-of-bounds behavior can be identified simply, and require strict conformance to the protocol.
Mitigation MIT-3
Strategy: Language Selection
- Use a language that does not allow this weakness to occur or provides constructs that make this weakness easier to avoid.
- If possible, choose a language or compiler that performs automatic bounds checking.
Mitigation MIT-4
Strategy: Libraries or Frameworks
- Use a vetted library or framework that does not allow this weakness to occur or provides constructs that make this weakness easier to avoid [REF-1482].
- Use libraries or frameworks that make it easier to handle numbers without unexpected consequences.
- Examples include safe integer handling packages such as SafeInt (C++) or IntegerLib (C or C++). [REF-106]
Mitigation MIT-8
Strategy: Input Validation
- Perform input validation on any numeric input by ensuring that it is within the expected range. Enforce that the input meets both the minimum and maximum requirements for the expected range.
- Use unsigned integers where possible. This makes it easier to perform validation for integer overflows. When signed integers are required, ensure that the range check includes minimum values as well as maximum values.
Mitigation MIT-36
- Understand the programming language's underlying representation and how it interacts with numeric calculation (CWE-681). Pay close attention to byte size discrepancies, precision, signed/unsigned distinctions, truncation, conversion and casting between types, "not-a-number" calculations, and how the language handles numbers that are too large or too small for its underlying representation. [REF-7]
- Also be careful to account for 32-bit, 64-bit, and other potential differences that may affect the numeric representation.
Mitigation MIT-15
For any security checks that are performed on the client side, ensure that these checks are duplicated on the server side, in order to avoid CWE-602. Attackers can bypass the client-side checks by modifying values after the checks have been performed, or by changing the client to remove the client-side checks entirely. Then, these modified values would be submitted to the server.
Mitigation MIT-26
Strategy: Compilation or Build Hardening
Examine compiler warnings closely and eliminate problems with potential security implications, such as signed / unsigned mismatch in memory operations, or use of uninitialized variables. Even if the weakness is rarely exploitable, a single failure may lead to the compromise of the entire system.
CAPEC-92: Forced Integer Overflow
This attack forces an integer variable to go out of range. The integer variable is often used as an offset such as size of memory allocation or similarly. The attacker would typically control the value of such variable and try to get it out of range. For instance the integer in question is incremented past the maximum possible value, it may wrap to become a very small, or negative number, therefore providing a very incorrect value which can lead to unexpected behavior. At worst the attacker can execute arbitrary code.