Skip to content
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

Merged
merged 2 commits into from
Oct 13, 2017
Merged

os.startfile(): add a C comment on security #3877

merged 2 commits into from
Oct 13, 2017

Conversation

vstinner
Copy link
Member

@vstinner vstinner commented Oct 3, 2017

LoadLibrary("SHELL32") is not vulnerable to DLL injection.

LoadLibrary("SHELL32") is not vulnerable to DLL injection.
@vstinner
Copy link
Member Author

vstinner commented Oct 3, 2017

@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.

@@ -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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

KnownDLLs

@@ -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
Copy link
Member

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"

@@ -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".
Copy link
Member

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.

@vstinner
Copy link
Member Author

vstinner commented Oct 4, 2017

Thank you for your review :-) I rewrote the comment according to your remarks.

@vstinner vstinner merged commit a991215 into python:master Oct 13, 2017
@vstinner vstinner deleted the shell32 branch October 13, 2017 20:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants