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

GS edge case #13

Open
woodruffw opened this issue Aug 30, 2018 · 2 comments
Open

GS edge case #13

woodruffw opened this issue Aug 30, 2018 · 2 comments
Labels
enhancement New feature or request good first issue Good for newcomers hacktoberfest

Comments

@woodruffw
Copy link
Member

Split out from #5: If the user defines a custom entrypoint via /ENTRY, we should verify that they call call __security_init_cookie(). If they fail to, we should mark GS as not enabled, as the stack cookie will be whatever the compile time value was.

@woodruffw woodruffw added the enhancement New feature or request label Aug 30, 2018
@woodruffw woodruffw added the good first issue Good for newcomers label Sep 12, 2018
@woodruffw
Copy link
Member Author

https://github.com/olliencc/WinBinaryAudit contains more advanced GS checks that we should probably build off of.

@woodruffw
Copy link
Member Author

To elaborate: the current /GS detection is probably over-sensitive, since every recent build of the Windows CRT has stack cookies enabled and uses the default cookie to protect _start at the very minimum.

Instead, we should be checking for /GS instrumentation in non-_start functions, which will look something like this in pseudo-assembly:

mov rax, [__security_cookie]
xor rax, rsp
# ...

where __security_cookie is pointed to by the RVA in the load config's SecurityCookie field.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers hacktoberfest
Projects
None yet
Development

No branches or pull requests

1 participant