CAS-002 · Question #235
A security code reviewer has been engaged to manually review a legacy application. A number of systemic issues have been uncovered relating to buffer overflows and format string vulnerabilities. The…
The correct answer is B. C# E. Java. Managed code environments such as C# and Java handle memory automatically at runtime, eliminating the manual memory management that causes buffer overflow and format string vulnerabilities.
Question
A security code reviewer has been engaged to manually review a legacy application. A number of systemic issues have been uncovered relating to buffer overflows and format string vulnerabilities. The reviewer has advised that future software projects utilize managed code platforms if at all possible. Which of the following languages would suit this recommendation? (Select TWO).
Options
- AC
- BC#
- CC++
- DPerl
- EJava
How the community answered
(20 responses)- B85% (17)
- C10% (2)
- D5% (1)
Why each option
Managed code environments such as C# and Java handle memory automatically at runtime, eliminating the manual memory management that causes buffer overflow and format string vulnerabilities.
C is an unmanaged language that requires explicit manual memory management, making it directly and inherently susceptible to buffer overflow and format string vulnerabilities.
C# executes on the .NET Common Language Runtime (CLR), which enforces automatic memory management, type safety, and bounds checking, preventing buffer overflows and format string attacks at the runtime level rather than relying on developer discipline.
C++ is also unmanaged and permits direct memory manipulation via raw pointers, retaining the same classes of memory safety vulnerabilities as C.
Perl is an interpreted language but does not provide the strict memory safety guarantees enforced by a managed runtime such as the CLR or JVM, so it does not qualify as a managed code platform in this context.
Java executes on the Java Virtual Machine (JVM), which performs automatic garbage collection and enforces strict type safety, eliminating the pointer arithmetic and manual memory allocation that are the root causes of buffer overflow vulnerabilities.
Concept tested: Managed code platforms for memory safety vulnerabilities
Source: https://learn.microsoft.com/en-us/dotnet/standard/managed-code
Topics
Community Discussion
No community discussion yet for this question.