SY0-501 · Question #193
An analyst is reviewing a simple program for potential security vulnerabilities before being deployed to a Windows server. Given the following code: Which of the following vulnerabilities is present?
The correct answer is B. Buffer overflow. The vulnerability present is a buffer overflow, which occurs when a program attempts to write more data into a fixed-size buffer than it was allocated, overwriting adjacent memory.
Question
An analyst is reviewing a simple program for potential security vulnerabilities before being deployed to a Windows server. Given the following code:
Which of the following vulnerabilities is present?
Exhibit
Options
- ABad memory pointer
- BBuffer overflow
- CInteger overflow
- DBackdoor
How the community answered
(28 responses)- A4% (1)
- B79% (22)
- C7% (2)
- D11% (3)
Why each option
The vulnerability present is a buffer overflow, which occurs when a program attempts to write more data into a fixed-size buffer than it was allocated, overwriting adjacent memory.
A bad memory pointer, while also a memory-related issue, typically refers to dereferencing an invalid or uninitialized pointer, leading to a crash or corruption, rather than specifically overflowing a designated buffer's boundaries.
A buffer overflow typically occurs when a program attempts to store data beyond the allocated size of a fixed-length buffer, such as using unsafe functions like `strcpy` or `sprintf` without proper bounds checking. This can overwrite adjacent memory locations, leading to program crashes, unpredictable behavior, or arbitrary code execution by an attacker.
An integer overflow occurs when an arithmetic operation produces a result larger than the maximum value that the data type can store, which is a distinct issue from writing data beyond the physical boundaries of a memory buffer.
A backdoor is an intentional, hidden method inserted into software to bypass security controls for unauthorized access, whereas a buffer overflow is generally an unintentional programming error that can be exploited.
Concept tested: Identifying buffer overflow vulnerabilities
Source: https://learn.microsoft.com/en-us/windows/win32/secbp/buffer-overruns
Topics
Community Discussion
No community discussion yet for this question.
