nerdexam
GIAC

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.

Vulnerability Exploitation & Privilege Escalation

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)
  • A
    3% (1)
  • B
    94% (29)
  • D
    3% (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.

AJava

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.

BC++Correct

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.

CCCorrect

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.

DAction script

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

#buffer overflow#memory unsafe languages#C#C++

Community Discussion

No community discussion yet for this question.

Full GCIH Practice