nerdexam
EC-Council

312-50V11 · Question #318

Which of the following programming languages is most vulnerable to buffer overflow attacks?

The correct answer is B. C++. C++ is most vulnerable to buffer overflow attacks because it allows direct memory manipulation without enforcing automatic bounds checking.

System Hacking

Question

Which of the following programming languages is most vulnerable to buffer overflow attacks?

Options

  • APerl
  • BC++
  • CPython
  • DJava

How the community answered

(19 responses)
  • A
    5% (1)
  • B
    89% (17)
  • C
    5% (1)

Why each option

C++ is most vulnerable to buffer overflow attacks because it allows direct memory manipulation without enforcing automatic bounds checking.

APerl

Perl is an interpreted scripting language that manages memory automatically, preventing direct memory address manipulation and buffer overflows.

BC++Correct

C++ inherits C's direct memory access model, allowing developers to use raw pointers and manual memory allocation functions like malloc/free and new/delete without automatic bounds enforcement. When input data exceeds allocated buffer size, the runtime does not prevent the overflow, allowing adjacent memory to be overwritten. This is the classic condition exploited in stack-based and heap-based buffer overflow attacks.

CPython

Python is an interpreted language with a managed runtime that enforces memory safety and raises exceptions on out-of-bounds access rather than allowing memory corruption.

DJava

Java runs on the JVM which enforces strict array bounds checking and automatic garbage collection, making buffer overflows impossible in pure Java code.

Concept tested: Buffer overflow vulnerability in unmanaged languages

Source: https://owasp.org/www-community/vulnerabilities/Buffer_Overflow

Topics

#buffer overflow#C++#memory safety#vulnerable languages

Community Discussion

No community discussion yet for this question.

Full 312-50V11 Practice