-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Use fully qualified pathname when loading DLL to prevent security vulnerability #4377
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…ulnerability Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com>
Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com>
…into jcw/fix-onnxifi-vlun
Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, not sure if the default LOAD_LIBRARY_SEARCH_DEFAULT_DIRS
is still needed as a fully qualified path is used. But maybe its used for something else... your call.
Can an approved accept this PR as it is a potential vulnerability. Thanks |
cc @onnx/sig-archinfra-approvers PTAL. Thanks! |
Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com>
Thanks for catching this. |
…nerability (onnx#4377) * Use a fully qualified pathname when loading DLL to prevent security vulnerability Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com> * use path instead of define Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com> * nit: style Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com> * LOAD_WITH_ALTERED_SEARCH_PATH Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com>
Description
To prevent security vulnerability, we should use fully qualified pathname when loading DLL.
Motivation and Context
Security vulnerability: The LoadLibrary*() family of functions are used to dynamically load a DLL into your
program. Most versions of the Windows operating system search the current directory first
when attempting to load files. If you do not specify a fully qualified pathname when loading
a Windows dynamic load library (DLL), the loader will attempt to locate the library in the
current directory. If there is a malicious library located in the current directory, it will be
loaded instead of the intended library.