microsoft / microsoft/binskim

[RULE REQUEST] Enable Stack Clash Protection

Open
#369 2 comments 0 reactions 0 assignees View on GitHub

A pull request for this has already been merged.

  • #379 by @shaopeng-gh — merged
  • #387 by @yongyan-gh — merged
rule-request
Dominant language
C#
Stars
860
Forks
178
Avg merge
5d 2h
Merged PRs (30d)
11

Description

Rule Proposal: Enable Stack Clash Protection

Rule metadata
  • Id: BA3005
  • Name: EnableStackClashProtection
Rule descriptions
  • Full: This check ensures that stack clash protection is enabled. Each program running on a computer uses a special memory region called the stack. This memory region is special because it grows automatically when the program needs more stack memory. But if it grows too much and gets too close to another memory region, the program may confuse the stack with the other memory region. An attacker can exploit this confusion to overwrite the stack with the other memory region, or the other way around. Use the compiler flags '-fstack-clash-protection' to enable this.
Platform & applicability
  • Platform: Unix
  • Applicable to: Linux (ELF) binaries
  • Not applicable to: Windows
User-facing strings
  • Fail: The Stack Clash Protection is missing from this binary, so the stack from '{0}' can clash/colide with another memory region. Ensure you are compiling with the compiler flags '-fstack-clash-protection' to address this.
  • Pass: The Stack Clash Protection was present, so '{0}' is protected.
Links/Additional Information

https://developers.redhat.com/blog/2018/03/21/compiler-and-linker-flags-gcc/

Implementation Notes

This should only be applied if you are compiling on GCC 8 or later.

How to resolve

-fstack-clash-protection

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Review the merged pull requests #379 and #387 first, since they are linked to this request. Verify that rule BA3005 covers Linux ELF binaries, is limited to GCC 8 or later, reports the specified pass and fail strings, and excludes Windows.

Written by the indexing model from the issue text.

Assessment

Domain
devtools, security
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.