SY0-501 · Question #478
A software developer is concerned about DLL hijacking in an application being written. Which of the following is the MOST viable mitigation measure of this type of attack?
The correct answer is B. All calls to different DLLs should be hard-coded in the application. To mitigate DLL hijacking, applications should explicitly define the full path for all DLL calls, preventing malicious DLLs from being loaded from unintended locations.
Question
A software developer is concerned about DLL hijacking in an application being written. Which of the following is the MOST viable mitigation measure of this type of attack?
Options
- AThe DLL of each application should be set individually
- BAll calls to different DLLs should be hard-coded in the application
- CAccess to DLLs from the Windows registry should be disabled
- DThe affected DLLs should be renamed to avoid future hijacking
How the community answered
(32 responses)- A13% (4)
- B78% (25)
- C6% (2)
- D3% (1)
Why each option
To mitigate DLL hijacking, applications should explicitly define the full path for all DLL calls, preventing malicious DLLs from being loaded from unintended locations.
The statement 'the DLL of each application should be set individually' is vague and does not describe a concrete technical mitigation for preventing DLL hijacking.
Hard-coding or explicitly specifying the full path for DLL calls, rather than relying on default search paths, prevents an attacker from inserting a malicious DLL with the same name into a vulnerable search location. This ensures the application always loads the intended, legitimate DLL.
DLLs are primarily loaded from the file system, not directly accessed from the Windows registry for execution, making disabling registry access an ineffective mitigation for file-system-based DLL hijacking.
Renaming legitimate DLLs would break application functionality unless the application's code is also updated, and it doesn't prevent an attacker from placing a malicious DLL under the original expected name or even the new name if known.
Concept tested: Secure DLL loading practices, preventing DLL hijacking
Source: https://learn.microsoft.com/en-us/windows/win32/dlls/dynamic-link-library-security
Topics
Community Discussion
No community discussion yet for this question.