CWE-787
Allowed-with-ReviewOut-of-bounds Write
Abstraction: Base · Status: Draft
The product writes data past the end, or before the beginning, of the intended buffer.
16728 vulnerabilities reference this CWE, most recent first.
GHSA-8VMJ-6582-MGCQ
Vulnerability from github – Published: 2022-09-21 00:00 – Updated: 2025-05-27 18:30A potential attacker can execute an arbitrary code at the time of the PEI phase and influence the subsequent boot stages. This can lead to the mitigations bypassing, physical memory contents disclosure, discovery of any secrets from any Virtual Machines (VMs) and bypassing memory isolation and confidential computing boundaries. Additionally, an attacker can build a payload which can be injected into the SMRAM memory. This issue affects: Module name: PlatformInitAdvancedPreMem SHA256: 644044fdb8daea30a7820e0f5f88dbf5cd460af72fbf70418e9d2e47efed8d9b Module GUID: EEEE611D-F78F-4FB9-B868-55907F169280 This issue affects: AMI Aptio 5.x.
{
"affected": [],
"aliases": [
"CVE-2022-26873"
],
"database_specific": {
"cwe_ids": [
"CWE-121",
"CWE-787"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2022-09-20T18:15:00Z",
"severity": "HIGH"
},
"details": "A potential attacker can execute an arbitrary code at the time of the PEI phase and influence the subsequent boot stages. This can lead to the mitigations bypassing, physical memory contents disclosure, discovery of any secrets from any Virtual Machines (VMs) and bypassing memory isolation and confidential computing boundaries. Additionally, an attacker can build a payload which can be injected into the SMRAM memory. This issue affects: Module name: PlatformInitAdvancedPreMem SHA256: 644044fdb8daea30a7820e0f5f88dbf5cd460af72fbf70418e9d2e47efed8d9b Module GUID: EEEE611D-F78F-4FB9-B868-55907F169280 This issue affects: AMI Aptio 5.x.",
"id": "GHSA-8vmj-6582-mgcq",
"modified": "2025-05-27T18:30:36Z",
"published": "2022-09-21T00:00:38Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2022-26873"
},
{
"type": "WEB",
"url": "https://www.ami.com/security-center"
},
{
"type": "WEB",
"url": "https://www.binarly.io/advisories/BRLY-2022-027"
},
{
"type": "WEB",
"url": "https://www.intel.com/content/www/us/en/security-center/advisory/intel-sa-00712.html"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:L/AC:L/PR:H/UI:N/S:C/C:H/I:H/A:H",
"type": "CVSS_V3"
}
]
}
GHSA-8VMP-Q2RF-GR57
Vulnerability from github – Published: 2022-05-24 19:11 – Updated: 2022-05-24 19:11A stack-based buffer overflow vulnerability exists in the command-line-parsing HandleFileArg functionality of AT&T Labs' Xmill 0.7. Within the function HandleFileArg the argument filepattern is under control of the user who passes it in from the command line. filepattern is passed directly to strcpy copying the path provided by the user into a staticly sized buffer without any length checks resulting in a stack-buffer overflow. An attacker can provide malicious input to trigger this vulnerability.
{
"affected": [],
"aliases": [
"CVE-2021-21815"
],
"database_specific": {
"cwe_ids": [
"CWE-787"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2021-08-13T23:15:00Z",
"severity": "HIGH"
},
"details": "A stack-based buffer overflow vulnerability exists in the command-line-parsing HandleFileArg functionality of AT\u0026T Labs\u0027 Xmill 0.7. Within the function HandleFileArg the argument filepattern is under control of the user who passes it in from the command line. filepattern is passed directly to strcpy copying the path provided by the user into a staticly sized buffer without any length checks resulting in a stack-buffer overflow. An attacker can provide malicious input to trigger this vulnerability.",
"id": "GHSA-8vmp-q2rf-gr57",
"modified": "2022-05-24T19:11:10Z",
"published": "2022-05-24T19:11:10Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2021-21815"
},
{
"type": "WEB",
"url": "https://talosintelligence.com/vulnerability_reports/TALOS-2021-1280"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H",
"type": "CVSS_V3"
}
]
}
GHSA-8VMR-Q5H8-3VC5
Vulnerability from github – Published: 2026-06-19 18:32 – Updated: 2026-10-19 12:31An arbitrary address write vulnerability was found in libaom, the reference AV1 codec implementation. A missing bounds check in the SVC (Scalable Video Coding) layer ID control function allows an attacker to inject an arbitrary pointer into the cyclic refresh map field via crafted image pixel values. The encoder then writes approximately 1,200 bytes at the attacker-controlled address. This is fully deterministic and does not require a separate information leak. An attacker who can supply frames to a network-facing libaom encoder with SVC enabled could exploit this for denial of service or potential code execution.
{
"affected": [],
"aliases": [
"CVE-2026-56209"
],
"database_specific": {
"cwe_ids": [
"CWE-787"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2026-06-19T17:16:30Z",
"severity": "HIGH"
},
"details": "An arbitrary address write vulnerability was found in libaom, the reference AV1 codec implementation. A missing bounds check in the SVC (Scalable Video Coding) layer ID control function allows an attacker to inject an arbitrary pointer into the cyclic refresh map field via crafted image pixel values. The encoder then writes approximately 1,200 bytes at the attacker-controlled address. This is fully deterministic and does not require a separate information leak. An attacker who can supply frames to a network-facing libaom encoder with SVC enabled could exploit this for denial of service or potential code execution.",
"id": "GHSA-8vmr-q5h8-3vc5",
"modified": "2026-10-19T12:31:34Z",
"published": "2026-06-19T18:32:34Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2026-56209"
},
{
"type": "WEB",
"url": "https://access.redhat.com/errata/RHSA-2026:69935"
},
{
"type": "WEB",
"url": "https://access.redhat.com/errata/RHSA-2026:71392"
},
{
"type": "WEB",
"url": "https://access.redhat.com/errata/RHSA-2026:71393"
},
{
"type": "WEB",
"url": "https://access.redhat.com/errata/RHSA-2026:71394"
},
{
"type": "WEB",
"url": "https://access.redhat.com/errata/RHSA-2026:71395"
},
{
"type": "WEB",
"url": "https://access.redhat.com/errata/RHSA-2026:71396"
},
{
"type": "WEB",
"url": "https://access.redhat.com/errata/RHSA-2026:71397"
},
{
"type": "WEB",
"url": "https://access.redhat.com/errata/RHSA-2026:71398"
},
{
"type": "WEB",
"url": "https://access.redhat.com/errata/RHSA-2026:71399"
},
{
"type": "WEB",
"url": "https://access.redhat.com/errata/RHSA-2026:71401"
},
{
"type": "WEB",
"url": "https://access.redhat.com/errata/RHSA-2026:74771"
},
{
"type": "WEB",
"url": "https://access.redhat.com/errata/RHSA-2026:75652"
},
{
"type": "WEB",
"url": "https://access.redhat.com/errata/RHSA-2026:75654"
},
{
"type": "WEB",
"url": "https://access.redhat.com/errata/RHSA-2026:75657"
},
{
"type": "WEB",
"url": "https://access.redhat.com/errata/RHSA-2026:75658"
},
{
"type": "WEB",
"url": "https://access.redhat.com/errata/RHSA-2026:75659"
},
{
"type": "WEB",
"url": "https://access.redhat.com/errata/RHSA-2026:75660"
},
{
"type": "WEB",
"url": "https://access.redhat.com/errata/RHSA-2026:76041"
},
{
"type": "WEB",
"url": "https://access.redhat.com/errata/RHSA-2026:76042"
},
{
"type": "WEB",
"url": "https://access.redhat.com/errata/RHSA-2026:76043"
},
{
"type": "WEB",
"url": "https://access.redhat.com/errata/RHSA-2026:84734"
},
{
"type": "WEB",
"url": "https://access.redhat.com/security/cve/CVE-2026-56209"
},
{
"type": "WEB",
"url": "https://aomedia.googlesource.com/aom/+/a93ba0ffaa"
},
{
"type": "WEB",
"url": "https://bugzilla.redhat.com/show_bug.cgi?id=2490800"
},
{
"type": "WEB",
"url": "https://issues.chromium.org/issues/503993984"
},
{
"type": "WEB",
"url": "https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-56209.json"
},
{
"type": "WEB",
"url": "https://access.redhat.com/errata/RHSA-2026:30814"
},
{
"type": "WEB",
"url": "https://access.redhat.com/errata/RHSA-2026:42875"
},
{
"type": "WEB",
"url": "https://access.redhat.com/errata/RHSA-2026:51100"
},
{
"type": "WEB",
"url": "https://access.redhat.com/errata/RHSA-2026:51146"
},
{
"type": "WEB",
"url": "https://access.redhat.com/errata/RHSA-2026:60520"
},
{
"type": "WEB",
"url": "https://access.redhat.com/errata/RHSA-2026:61627"
},
{
"type": "WEB",
"url": "https://access.redhat.com/errata/RHSA-2026:61628"
},
{
"type": "WEB",
"url": "https://access.redhat.com/errata/RHSA-2026:61629"
},
{
"type": "WEB",
"url": "https://access.redhat.com/errata/RHSA-2026:68634"
},
{
"type": "WEB",
"url": "https://access.redhat.com/errata/RHSA-2026:68637"
},
{
"type": "WEB",
"url": "https://access.redhat.com/errata/RHSA-2026:68638"
},
{
"type": "WEB",
"url": "https://access.redhat.com/errata/RHSA-2026:68639"
},
{
"type": "WEB",
"url": "https://access.redhat.com/errata/RHSA-2026:68640"
},
{
"type": "WEB",
"url": "https://access.redhat.com/errata/RHSA-2026:68696"
},
{
"type": "WEB",
"url": "https://access.redhat.com/errata/RHSA-2026:68697"
},
{
"type": "WEB",
"url": "https://access.redhat.com/errata/RHSA-2026:68698"
},
{
"type": "WEB",
"url": "https://access.redhat.com/errata/RHSA-2026:68699"
},
{
"type": "WEB",
"url": "https://access.redhat.com/errata/RHSA-2026:68708"
},
{
"type": "WEB",
"url": "https://access.redhat.com/errata/RHSA-2026:68709"
},
{
"type": "WEB",
"url": "https://access.redhat.com/errata/RHSA-2026:68710"
},
{
"type": "WEB",
"url": "https://access.redhat.com/errata/RHSA-2026:69927"
},
{
"type": "WEB",
"url": "https://access.redhat.com/errata/RHSA-2026:69929"
},
{
"type": "WEB",
"url": "https://access.redhat.com/errata/RHSA-2026:69930"
},
{
"type": "WEB",
"url": "https://access.redhat.com/errata/RHSA-2026:69931"
},
{
"type": "WEB",
"url": "https://access.redhat.com/errata/RHSA-2026:69932"
},
{
"type": "WEB",
"url": "https://access.redhat.com/errata/RHSA-2026:69933"
},
{
"type": "WEB",
"url": "https://access.redhat.com/errata/RHSA-2026:69934"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:H",
"type": "CVSS_V3"
}
]
}
GHSA-8VQQ-VP59-HXPX
Vulnerability from github – Published: 2024-11-22 21:32 – Updated: 2024-11-22 21:32IrfanView DXF File Parsing Memory Corruption Remote Code Execution Vulnerability. This vulnerability allows remote attackers to execute arbitrary code on affected installations of IrfanView. User interaction is required to exploit this vulnerability in that the target must visit a malicious page or open a malicious file.
The specific flaw exists within the parsing of DXF files. The issue results from the lack of proper validation of user-supplied data, which can result in a memory corruption condition. An attacker can leverage this vulnerability to execute code in the context of the current process. Was ZDI-CAN-24897.
{
"affected": [],
"aliases": [
"CVE-2024-11572"
],
"database_specific": {
"cwe_ids": [
"CWE-119",
"CWE-787"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2024-11-22T21:15:16Z",
"severity": "HIGH"
},
"details": "IrfanView DXF File Parsing Memory Corruption Remote Code Execution Vulnerability. This vulnerability allows remote attackers to execute arbitrary code on affected installations of IrfanView. User interaction is required to exploit this vulnerability in that the target must visit a malicious page or open a malicious file.\n\nThe specific flaw exists within the parsing of DXF files. The issue results from the lack of proper validation of user-supplied data, which can result in a memory corruption condition. An attacker can leverage this vulnerability to execute code in the context of the current process. Was ZDI-CAN-24897.",
"id": "GHSA-8vqq-vp59-hxpx",
"modified": "2024-11-22T21:32:18Z",
"published": "2024-11-22T21:32:18Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2024-11572"
},
{
"type": "WEB",
"url": "https://www.zerodayinitiative.com/advisories/ZDI-24-1570"
}
],
"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-8VQV-GV6P-PJJR
Vulnerability from github – Published: 2022-12-23 00:30 – Updated: 2022-12-30 03:30A heap based buffer overflow vulnerability exists in tile decoding code of TIFF image parser in OpenImageIO master-branch-9aeece7a and v2.3.19.0. A specially-crafted TIFF file can lead to an out of bounds memory corruption, which can result in arbitrary code execution. An attacker can provide a malicious file to trigger this vulnerability.
{
"affected": [],
"aliases": [
"CVE-2022-41639"
],
"database_specific": {
"cwe_ids": [
"CWE-122",
"CWE-787"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2022-12-22T22:15:00Z",
"severity": "CRITICAL"
},
"details": "A heap based buffer overflow vulnerability exists in tile decoding code of TIFF image parser in OpenImageIO master-branch-9aeece7a and v2.3.19.0. A specially-crafted TIFF file can lead to an out of bounds memory corruption, which can result in arbitrary code execution. An attacker can provide a malicious file to trigger this vulnerability.",
"id": "GHSA-8vqv-gv6p-pjjr",
"modified": "2022-12-30T03:30:19Z",
"published": "2022-12-23T00:30:24Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2022-41639"
},
{
"type": "WEB",
"url": "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/T3LET4MEPBSBJZK4EMLEBY4FUXKU5BMN"
},
{
"type": "WEB",
"url": "https://security.gentoo.org/glsa/202305-33"
},
{
"type": "WEB",
"url": "https://talosintelligence.com/vulnerability_reports/TALOS-2022-1633"
},
{
"type": "WEB",
"url": "https://www.debian.org/security/2023/dsa-5384"
}
],
"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-8VQV-J9XM-99CX
Vulnerability from github – Published: 2022-06-07 00:00 – Updated: 2022-06-14 00:00In WLAN driver, there is a possible out of bounds write due to a missing bounds check. This could lead to local escalation of privilege with System execution privileges needed. User interaction is not needed for exploitation. Patch ID: ALPS06535953; Issue ID: ALPS06535953.
{
"affected": [],
"aliases": [
"CVE-2022-21754"
],
"database_specific": {
"cwe_ids": [
"CWE-787"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2022-06-06T18:15:00Z",
"severity": "MODERATE"
},
"details": "In WLAN driver, there is a possible out of bounds write due to a missing bounds check. This could lead to local escalation of privilege with System execution privileges needed. User interaction is not needed for exploitation. Patch ID: ALPS06535953; Issue ID: ALPS06535953.",
"id": "GHSA-8vqv-j9xm-99cx",
"modified": "2022-06-14T00:00:26Z",
"published": "2022-06-07T00:00:32Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2022-21754"
},
{
"type": "WEB",
"url": "https://corp.mediatek.com/product-security-bulletin/June-2022"
}
],
"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"
}
]
}
GHSA-8VR3-F3HC-V255
Vulnerability from github – Published: 2022-05-24 16:54 – Updated: 2022-05-24 16:54Adobe Photoshop CC versions 19.1.8 and earlier and 20.0.5 and earlier have an out of bound write vulnerability. Successful exploitation could lead to arbitrary code execution.
{
"affected": [],
"aliases": [
"CVE-2019-7976"
],
"database_specific": {
"cwe_ids": [
"CWE-787"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2019-08-26T18:15:00Z",
"severity": "HIGH"
},
"details": "Adobe Photoshop CC versions 19.1.8 and earlier and 20.0.5 and earlier have an out of bound write vulnerability. Successful exploitation could lead to arbitrary code execution.",
"id": "GHSA-8vr3-f3hc-v255",
"modified": "2022-05-24T16:54:49Z",
"published": "2022-05-24T16:54:49Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2019-7976"
},
{
"type": "WEB",
"url": "https://helpx.adobe.com/security/products/photoshop/apsb19-44.html"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-8VR5-2C4M-8X5V
Vulnerability from github – Published: 2023-10-30 03:30 – Updated: 2023-11-04 03:30In International Color Consortium DemoIccMAX 79ecb74, CIccCLUT::Interp3d in IccProfLib/IccTagLut.cpp in libSampleICC.a attempts to access array elements at out-of-bounds indexes.
{
"affected": [],
"aliases": [
"CVE-2023-46866"
],
"database_specific": {
"cwe_ids": [
"CWE-787"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2023-10-30T03:15:07Z",
"severity": "MODERATE"
},
"details": "In International Color Consortium DemoIccMAX 79ecb74, CIccCLUT::Interp3d in IccProfLib/IccTagLut.cpp in libSampleICC.a attempts to access array elements at out-of-bounds indexes.",
"id": "GHSA-8vr5-2c4m-8x5v",
"modified": "2023-11-04T03:30:19Z",
"published": "2023-10-30T03:30:15Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2023-46866"
},
{
"type": "WEB",
"url": "https://github.com/InternationalColorConsortium/DemoIccMAX/issues/54"
},
{
"type": "WEB",
"url": "https://github.com/InternationalColorConsortium/DemoIccMAX/pull/53"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H",
"type": "CVSS_V3"
}
]
}
GHSA-8VR7-33JP-GFGW
Vulnerability from github – Published: 2024-12-19 09:30 – Updated: 2024-12-19 09:30A heap-based buffer overflow vulnerability in the processing of Link Control Protocol messages in FortiGate versions 5.6.12, 6.0.10, 6.2.4 and 6.4.1 and earlier may allow a remote attacker with valid SSL VPN credentials to crash the SSL VPN daemon by sending a large LCP packet, when tunnel mode is enabled. Arbitrary code execution may be theoretically possible, albeit practically very difficult to achieve in this context
{
"affected": [],
"aliases": [
"CVE-2020-12819"
],
"database_specific": {
"cwe_ids": [
"CWE-122",
"CWE-787"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2024-12-19T08:15:11Z",
"severity": "MODERATE"
},
"details": "A heap-based buffer overflow vulnerability in the processing of Link Control Protocol messages in FortiGate versions 5.6.12, 6.0.10, 6.2.4 and 6.4.1 and earlier may allow a remote attacker with valid SSL VPN credentials to crash the SSL VPN daemon by sending a large LCP packet, when tunnel mode is enabled. Arbitrary code execution may be theoretically possible, albeit practically very difficult to achieve in this context",
"id": "GHSA-8vr7-33jp-gfgw",
"modified": "2024-12-19T09:30:47Z",
"published": "2024-12-19T09:30:47Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2020-12819"
},
{
"type": "WEB",
"url": "https://fortiguard.com/advisory/FG-IR-20-082"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:L",
"type": "CVSS_V3"
}
]
}
GHSA-8VRP-7FG6-82G7
Vulnerability from github – Published: 2025-05-06 09:31 – Updated: 2025-05-06 09:31Memory corruption while triggering commands in the PlayReady Trusted application.
{
"affected": [],
"aliases": [
"CVE-2024-49844"
],
"database_specific": {
"cwe_ids": [
"CWE-20",
"CWE-787"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2025-05-06T09:15:22Z",
"severity": "HIGH"
},
"details": "Memory corruption while triggering commands in the PlayReady Trusted application.",
"id": "GHSA-8vrp-7fg6-82g7",
"modified": "2025-05-06T09:31:33Z",
"published": "2025-05-06T09:31:33Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2024-49844"
},
{
"type": "WEB",
"url": "https://docs.qualcomm.com/product/publicresources/securitybulletin/may-2025-bulletin.html"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H",
"type": "CVSS_V3"
}
]
}
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.
- For example, many languages that perform their own memory management, such as Java and Perl, are not subject to buffer overflows. Other languages, such as Ada and C#, typically provide overflow protection, but the protection can be disabled by the programmer.
- Be wary that a language's interface to native code may still be subject to overflows, even if the language itself is theoretically safe.
Mitigation MIT-4.1
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.
- Examples include the Safe C String Library (SafeStr) by Messier and Viega [REF-57], and the Strsafe.h library from Microsoft [REF-56]. These libraries provide safer versions of overflow-prone string-handling functions.
Mitigation MIT-10
Strategy: Environment Hardening
- Use automatic buffer overflow detection mechanisms that are offered by certain compilers or compiler extensions. Examples include: the Microsoft Visual Studio /GS flag, Fedora/Red Hat FORTIFY_SOURCE GCC flag, StackGuard, and ProPolice, which provide various mechanisms including canary-based detection and range/index checking.
- D3-SFCV (Stack Frame Canary Validation) from D3FEND [REF-1334] discusses canary-based detection in detail.
Mitigation MIT-9
- Consider adhering to the following rules when allocating and managing an application's memory:
- Double check that the buffer is as large as specified.
- When using functions that accept a number of bytes to copy, such as strncpy(), be aware that if the destination buffer size is equal to the source buffer size, it may not NULL-terminate the string.
- Check buffer boundaries if accessing the buffer in a loop and make sure there is no danger of writing past the allocated space.
- If necessary, truncate all input strings to a reasonable length before passing them to the copy and concatenation functions.
Mitigation MIT-11
Strategy: Environment Hardening
- Run or compile the software using features or extensions that randomly arrange the positions of a program's executable and libraries in memory. Because this makes the addresses unpredictable, it can prevent an attacker from reliably jumping to exploitable code.
- Examples include Address Space Layout Randomization (ASLR) [REF-58] [REF-60] and Position-Independent Executables (PIE) [REF-64]. Imported modules may be similarly realigned if their default memory addresses conflict with other modules, in a process known as "rebasing" (for Windows) and "prelinking" (for Linux) [REF-1332] using randomly generated addresses. ASLR for libraries cannot be used in conjunction with prelink since it would require relocating the libraries at run-time, defeating the whole purpose of prelinking.
- For more information on these techniques see D3-SAOR (Segment Address Offset Randomization) from D3FEND [REF-1335].
Mitigation MIT-12
Strategy: Environment Hardening
- Use a CPU and operating system that offers Data Execution Protection (using hardware NX or XD bits) or the equivalent techniques that simulate this feature in software, such as PaX [REF-60] [REF-61]. These techniques ensure that any instruction executed is exclusively at a memory address that is part of the code segment.
- For more information on these techniques see D3-PSEP (Process Segment Execution Prevention) from D3FEND [REF-1336].
Mitigation MIT-13
Replace unbounded copy functions with analogous functions that support length arguments, such as strcpy with strncpy. Create these if they are not available.
No CAPEC attack patterns related to this CWE.