-
-
Notifications
You must be signed in to change notification settings - Fork 31.4k
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
os.startfile(): add a C comment on security #3877
Conversation
LoadLibrary("SHELL32") is not vulnerable to DLL injection.
@zooba gave me the link https://blogs.msdn.microsoft.com/larryosterman/2004/07/19/what-are-known-dlls-anyway/ but I don't think that it's worth it to mention it in the comment. |
Modules/posixmodule.c
Outdated
@@ -10559,6 +10559,10 @@ check_ShellExecute() | |||
/* only recheck */ | |||
if (-1 == has_ShellExecute) { | |||
Py_BEGIN_ALLOW_THREADS | |||
/* Security note: this call is not vulnerable to "DLL injection". | |||
SHELL32 is part of "KnownDLL" and so Windows always load |
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.
KnownDLLs
Modules/posixmodule.c
Outdated
@@ -10559,6 +10559,10 @@ check_ShellExecute() | |||
/* only recheck */ | |||
if (-1 == has_ShellExecute) { | |||
Py_BEGIN_ALLOW_THREADS | |||
/* Security note: this call is not vulnerable to "DLL injection". | |||
SHELL32 is part of "KnownDLL" and so Windows always load | |||
the system SHELL32.DLL, even if they are other SHELL32.DLL |
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.
"if there is another SHELL32.DLL"
Modules/posixmodule.c
Outdated
@@ -10559,6 +10559,10 @@ check_ShellExecute() | |||
/* only recheck */ | |||
if (-1 == has_ShellExecute) { | |||
Py_BEGIN_ALLOW_THREADS | |||
/* Security note: this call is not vulnerable to "DLL injection". |
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.
Strictly, it's DLL hijacking. DLL injection is something else.
Thank you for your review :-) I rewrote the comment according to your remarks. |
LoadLibrary("SHELL32") is not vulnerable to DLL injection.