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

[RULE REQUEST] Enable Non-Executable Stack #368

Open
eddynaka opened this issue May 3, 2021 · 0 comments · Fixed by #383
Open

[RULE REQUEST] Enable Non-Executable Stack #368

eddynaka opened this issue May 3, 2021 · 0 comments · Fixed by #383

Comments

@eddynaka
Copy link
Contributor

eddynaka commented May 3, 2021

Rule Proposal: Enable Non-Executable Stack

Rule metadata

  • Id: BA3006
  • Name: EnableNonExecutableStack

Rule descriptions

  • Full: This check ensures that non-executable stack is enabled. A common type of exploit is the stack buffer overflow. An application receives, from an attacker, more data than it is prepared for and stores this information on its stack, writing beyond the space reserved for it. This can be designed to cause execution of the data written on the stack. One mechanism to mitigate this vulnerability is for the system to not allow the execution of instructions in sections of memory identified as part of the stack. Use the compiler flags '-z noexecstack' to enable this.

Platform & applicability

  • Platform: Unix
  • Applicable to: Linux (ELF) binaries
  • Not applicable to: Windows

User-facing strings

  • Fail: The non-executable stack is not enabled for this binary, so '{0}' can have a vulnerability of execution of the data written on the stack. Ensure you are compiling with the flag '-z noexecstack' to address this.
  • Pass: The non-executable stack flag was present, so '{0}' is protected.

Links/Additional Information

https://linux.die.net/man/8/execstack
https://gcc.gnu.org/onlinedocs/gcc/Link-Options.html#index-z (check z argument)

Implementation Notes

How to resolve

-z noexecstack

@eddynaka eddynaka linked a pull request Jun 11, 2021 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant