---
id: CVE-2018-12886
title: >-
  stack_protect_prologue in cfgexpand.c and stack_protect_epilogue in function.c
  in GNU Compiler Collection (GCC) 4.1 through 8 (under certain circumstances)
  generate instruction sequences when targeting ARM targets that spill the
  address …
summary: >-
  stack_protect_prologue in cfgexpand.c and stack_protect_epilogue in function.c
  in GNU Compiler Collection (GCC) 4.1 through 8 (under certain circumstances)
  generate instruction sequences when targeting ARM targets that spill the
  address …
severity: high
cvss: 8.1
cvssVector: 'CVSS:3.0/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H'
cwe:
  - CWE-209
vendor: gnu
product: gcc
affected:
  - 'gcc >= 4.1, <= 8.0'
published: '2019-05-22'
updated: '2026-10-14'
sourceUpdated: '2026-10-14T07:16:41.957'
source: NVD
sourceUrl: 'https://nvd.nist.gov/vuln/detail/CVE-2018-12886'
references:
  - url: >-
      https://gcc.gnu.org/viewcvs/gcc/trunk/gcc/config/arm/arm-protos.h?revision=266379&view=markup
    label: cve@mitre.org
  - url: 'https://www.gnu.org/software/gcc/gcc-8/changes.html'
    label: cve@mitre.org
  - url: >-
      https://gcc.gnu.org/viewcvs/gcc/trunk/gcc/config/arm/arm-protos.h?revision=266379&view=markup
    label: af854a3a-2127-422b-91ae-364da2661108
  - url: 'https://www.gnu.org/software/gcc/gcc-8/changes.html'
    label: af854a3a-2127-422b-91ae-364da2661108
  - url: 'https://cert-portal.siemens.com/productcert/html/ssa-398330.html'
    label: 0b142b55-0307-4c5a-b3c9-f314f3fb7c5e
  - url: 'https://cert-portal.siemens.com/productcert/html/ssa-565386.html'
    label: 0b142b55-0307-4c5a-b3c9-f314f3fb7c5e
tags:
  - nvd
epss: 0.02171
epssPercentile: 0.81823
ingestedAt: '2026-10-14T07:21:04.813Z'
---

## Overview

stack_protect_prologue in cfgexpand.c and stack_protect_epilogue in function.c in GNU Compiler Collection (GCC) 4.1 through 8 (under certain circumstances) generate instruction sequences when targeting ARM targets that spill the address of the stack protector guard, which allows an attacker to bypass the protection of -fstack-protector, -fstack-protector-all, -fstack-protector-strong, and -fstack-protector-explicit against stack overflow by controlling what the stack canary is compared against.

## Affected

- `gcc >= 4.1, <= 8.0`

## Remediation

Refer to the linked advisories for vendor-supplied fixes and affected version ranges.
