nerdexam
GIAC

GPEN · Question #35

Which of the following programming languages are NOT vulnerable to buffer overflow attacks? Each correct answer represents a complete solution. Choose two.

The correct answer is A. Perl C. Java. Java and Perl use managed runtime environments with automatic memory and bounds management, inherently preventing buffer overflows, while C and C++ expose raw memory access with no automatic bounds checking.

Exploitation & Post-Exploitation Techniques

Question

Which of the following programming languages are NOT vulnerable to buffer overflow attacks? Each correct answer represents a complete solution. Choose two.

Options

  • APerl
  • BC++
  • CJava
  • DC

How the community answered

(30 responses)
  • A
    80% (24)
  • B
    13% (4)
  • D
    7% (2)

Why each option

Java and Perl use managed runtime environments with automatic memory and bounds management, inherently preventing buffer overflows, while C and C++ expose raw memory access with no automatic bounds checking.

APerlCorrect

Perl uses an interpreted, managed runtime that automatically handles memory allocation and enforces array bounds, eliminating the direct pointer manipulation that causes buffer overflow vulnerabilities.

BC++

C++ supports raw pointer manipulation and manual memory allocation without automatic bounds checking, leaving it fully susceptible to buffer overflow vulnerabilities.

CJavaCorrect

Java executes on the JVM, which enforces strict array bounds checking at runtime and prohibits direct pointer arithmetic, making classic stack and heap buffer overflow attacks impossible in pure Java code.

DC

C relies entirely on manual memory management with pointer arithmetic and no built-in array bounds enforcement, making it historically the most vulnerable language to buffer overflow exploits.

Concept tested: Buffer overflow vulnerability by programming language

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

Topics

#buffer overflow#memory-safe languages#Java#language security

Community Discussion

No community discussion yet for this question.

Full GPEN Practice