CVE-2008-1685
published 2008-04-06CVE-2008-1685: gcc 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 or equal to the…
PriorityP423medium6.8CVSS 2.0
AVNACMAuNCPIPAP
EPSS
1.25%
66.0th percentile
gcc 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 or equal to the pointer, which might lead to removal of length testing code that was intended as a protection mechanism against integer overflow and buffer overflow attacks, and provide no diagnostic message about this removal. NOTE: the vendor has determined that this compiler behavior is correct according to section 6.5.6 of the C99 standard (aka ISO/IEC 9899:1999)
Affected
6 ranges
| Vendor | Product | Version range | Fixed in |
|---|---|---|---|
| gnu | gcc | — | — |
| gnu | gcc | — | — |
| gnu | gcc | — | — |
| gnu | gcc | — | — |
| gnu | gcc | — | — |
| gnu | gcc | — | — |
CVSS provenance
nvdv2.06.8MEDIUMAV:N/AC:M/Au:N/C:P/I:P/A:P
vendor_redhat6.8MEDIUM
Stop checking back — get the weekly exploitation signal.
Every Monday: what got weaponized or added to CISA KEV in the last seven days — each CVE cross-linked to its PoC, Nuclei template, and detection rule. Free, one email a week, unsubscribe in one click.
GHSA
GHSA-6pf5-463c-qv74: ** DISPUTED ** gcc 4
ghsa_unreviewed·2022-05-01
CVE-2008-1685 [MEDIUM] CWE-119 GHSA-6pf5-463c-qv74: ** DISPUTED ** gcc 4
** DISPUTED ** gcc 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 or equal to the pointer, which might lead to removal of length testing code that was intended as a protection mechanism against integer overflow and buffer overflow attacks, and provide no diagnostic message about this removal. NOTE: the vendor has determined that this compiler behavior is correct according to section 6.5.6 of the C99 standard (aka ISO/IEC 9899:1999).
Red Hat
gcc: gcc-4.2 may optimize out certain length checks
vendor_redhat·2008-03-30·CVSS 6.8
CVE-2008-1685 [MEDIUM] gcc: gcc-4.2 may optimize out certain length checks
gcc: gcc-4.2 may optimize out certain length checks
gcc 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 or equal to the pointer, which might lead to removal of length testing code that was intended as a protection mechanism against integer overflow and buffer overflow attacks, and provide no diagnostic message about this removal. NOTE: the vendor has determined that this compiler behavior is correct according to section 6.5.6 of the C99 standard (aka ISO/IEC 9899:1999)
Statement: The Red Hat Product Security is aware of this new gcc behavior and is currently working to determine what impact these changes will have on the source code processed by the compiler. These changes do not affect Red Hat Enterpri
No detection rules found.
CWE
Insecure Automated Optimizations
mitre_cwe
CWE-1038 Insecure Automated Optimizations
CWE-1038: Insecure Automated Optimizations
The product uses a mechanism that automatically optimizes code, e.g. to improve a characteristic such as performance, but the optimizations can have an unintended side effect that might violate an intended security assumption.
Modes of Introduction:
Phase: Architecture and Design
Note: Optimizations built into the design of a product can have unintended consequences during execution.
Common Consequences:
Scope: Integrity. Impact: Alter Execution Logic. The optimizations alter the order of execution resulting in side effects that were not intended by the original developer.
Examples:
The following code reads a password from the
user, uses the password to connect to a back-end
mainframe, and then attempts to scrub the password from
memory using
CWE
Compiler Optimization Removal or Modification of Security-critical Code
mitre_cwe
CWE-733 Compiler Optimization Removal or Modification of Security-critical Code
CWE-733: Compiler Optimization Removal or Modification of Security-critical Code
The developer builds a security-critical protection mechanism into the software, but the compiler optimizes the program such that the mechanism is removed or modified.
Modes of Introduction:
Phase: Build and Compilation
Common Consequences:
Scope: Access Control, Other. Impact: Bypass Protection Mechanism, Alter Execution Logic.
Detection Methods:
Black Box: This specific weakness is impossible to detect using black box methods. While an analyst could examine memory to see that it has not been scrubbed, an analysis of the executable would not be successful. This is because the compiler has already removed the relevant code. Only the source code shows whether the programmer intended to clear the memory or n
2008-04-06
Published