fold_binary in fold-const.c in GNU Compiler Collection (gcc) 4.1 improperly handles pointer overflow when folding a certain expr comparison
fold_binary in fold-const.c in GNU Compiler Collection (gcc) 4.1 improperly handles pointer overflow when folding a certain expr comparison to a corresponding offset comparison in cases other than EQ_EXPR and NE_EXPR, which might introduce buffer overflow vulnerabilities into applications that could be exploited by context-dependent attackers.NOTE: the vendor states that the essence of the issue is "not correctly interpreting an offset to a pointer as a signed value."
- Published
- Apr 20, 2006
- Updated
- Jun 16, 2026
- EPSS
- 0.4% · 34th percentile
- CWE
- CWE-119
Sign in to follow · You’ll be notified if a followed record enters KEV, gets an exploit or is updated.
Report tools
Action score
8
Monitor
Low priority for now.
- CVSS
- 8 / 40 · 2.1 / 10
- CISA KEV
- 0 / 30 · Not listed
- EPSS
- 0 / 30 · 0.4%
Affected systems
| Vendor | Product | CPE |
|---|---|---|
| gnu | gcc | cpe:2.3:a:gnu:gcc |
Affected versions
NVD version ranges (for catalog products). Add the product to your stack with a version and matching uses these.
- gnu gcc4.1
Same product
gnu: all recordsOther highest-scoring records for the same primary product.
- CVE-2018-12886stack_protect_prologue in cfgexpand.c and stack_protect_epilogue in function.c in GNU Compiler Collection (GCC) 4.1 through 8 (under certain33Monitor
- CVE-2002-2439Integer overflow in the new[] operator in gcc before 4.8.0 allows attackers to have unspecified impacts.31Monitor
- CVE-2019-15847The POWER9 backend in GNU Compiler Collection (GCC) before version 10 could optimize multiple calls of the __builtin_darn intrinsic into a s31Monitor
- CVE-2008-1367gcc 4.3.x does not generate a cld instruction while compiling functions used for string manipulation such as memcpy and memmove on x86 and i31Monitor
- CVE-2008-1685gcc 4.2.0 through 4.3.0 in GNU Compiler Collection, when casts are not used, considers the sum of a pointer and an int to be greater than or27Monitor
- CVE-2021-3826Heap/stack buffer overflow in the dlang_lname function in d-demangle.c in libiberty allows attackers to potentially cause a denial of servic26Monitor
Remediation
Which version to upgrade to
Fix versions compiled from the vendor, package registries and Microsoft. Verify the vendor's note before upgrading.
No fix version is recorded for this entry. Check the references for vendor advisories.
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.
FIRST EPSS daily score; only changes of 0.01 or more are recorded (step chart).
Patch and commit links
Commit, PR and diff links among the references. A starting point for patch-diffing and variant hunting; fixes, not exploits.
No commit or PR link among the references.
Credits
All researchersFinders, reporters and analysts named in the CNA record. Click a name for that researcher’s other records.
No credits in the CNA record.
Variant candidates
Same product, same weakness class, within 18 months. If the patch missed the root cause, the sibling bug is here.
No nightly-computed relations.
Chain candidates
An authentication bypass and a privilege-requiring bug in the same product, published close together: combined they may become an unauthenticated path.
—
Bug bounty scope
No known public program.
Source: bounty-targets-data (public HackerOne, Bugcrowd, Intigriti, YesWeHack listings).
Technical details
Attack conditions
- No special conditions are required; it is repeatable.
If successful
- Confidentiality
- none
- Integrity
- P · data or configuration can be modified
- Availability
- none
- Attack complexity
- Low
- Confidentiality impact
- None
- Integrity impact
- P
- Availability impact
- None
Weakness class (CWE)
CWE-119 · Improper Restriction of Operations within the Bounds of a Memory BufferCVSS vector
AV:L/AC:L/Au:N/C:N/I:P/A:N
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)
- Buffer Overflow via Environment VariablesCAPEC-10likelihood: High · High
- Overflow BuffersCAPEC-100likelihood: High · Very High
- Buffer ManipulationCAPEC-123likelihood: High · Very High
- Client-side Injection-induced Buffer OverflowCAPEC-14likelihood: Medium · High
- Filter Failure through Buffer OverflowCAPEC-24likelihood: High · High
- MIME ConversionCAPEC-42likelihood: High · High
- Overflow Binary Resource FileCAPEC-44likelihood: High · Very High
- Buffer Overflow via Symbolic LinksCAPEC-45likelihood: High · High
ATT&CK techniques
—
Noroxi analysis
No Noroxi analysis for this record yet
We don't hand-write analysis for all 385,000+ vulnerabilities; that wouldn't be honest. For notable, high-impact vulnerabilities our team writes the mechanism, detection and remediation steps.
We use this product, ask for helpChange log
No changes recorded on tracked fields yet. Score, KEV, exploit maturity and fix status changes appear here.
References
- bugs.debian.org/cgi-bin/bugreport.cgi?bug=356896
- gcc.gnu.org/bugzilla/show_bug.cgi?id=26763
- gcc.gnu.org/ml/gcc-bugs/2006-04/msg01297.html
- gcc.gnu.org/ml/gcc-bugs/2006-04/msg01298.html
- gcc.gnu.org/viewcvs/branches/gcc-4_1-branch/gcc/fold-const.c?r1=110549&r2=112698&pathrev=112698&diff_format=h
- www.securityfocus.com/archive/1/431184/100/0/threaded
- www.securityfocus.com/archive/1/431245/100/0/threaded
- www.securityfocus.com/archive/1/431297/100/0/threaded
- www.securityfocus.com/archive/1/431319/100/0/threaded
Vendor advisories and official records. Exploit/PoC links are deliberately left out.