GCIH · Question #205
Which of the following languages are vulnerable to a buffer overflow attack? Each correct answer represents a complete solution. Choose all that apply.
The correct answer is B. C++ C. C. C and C++ lack built-in memory bounds checking, making them susceptible to buffer overflow attacks, while Java and ActionScript run on managed runtimes that enforce memory safety.
Question
Which of the following languages are vulnerable to a buffer overflow attack? Each correct answer represents a complete solution. Choose all that apply.
Options
- AJava
- BC++
- CC
- DAction script
How the community answered
(31 responses)- A3% (1)
- B94% (29)
- D3% (1)
Why each option
C and C++ lack built-in memory bounds checking, making them susceptible to buffer overflow attacks, while Java and ActionScript run on managed runtimes that enforce memory safety.
Java runs on the Java Virtual Machine (JVM), which performs automatic bounds checking on all array accesses and manages memory via garbage collection, preventing traditional buffer overflow conditions.
C++ does not perform automatic bounds checking on arrays or buffers, so writing beyond an allocated memory region can overwrite adjacent memory and enable buffer overflow exploits. Developers must manually manage memory, and any oversight can create vulnerabilities that attackers can leverage to execute arbitrary code.
C is the language most classically associated with buffer overflows because it provides direct memory access and pointer arithmetic without any runtime bounds enforcement, making standard library functions like strcpy() and gets() notoriously exploitable.
ActionScript executes within the Flash runtime environment, which abstracts memory management and enforces bounds checking, eliminating the conditions required for a buffer overflow.
Concept tested: Buffer overflow vulnerability in unmanaged programming languages
Source: https://owasp.org/www-community/vulnerabilities/Buffer_Overflow
Topics
Community Discussion
No community discussion yet for this question.