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

[Security Solution] Identify and exclude 24H2+ hotpatch extension pages from stomp detection #192490

Merged

Conversation

gabriellandau
Copy link
Contributor

@gabriellandau gabriellandau commented Sep 10, 2024

Release Note

Defend 8.15.2 will improve support for Windows call stack module stomp detection in Windows 11 24H2.

Description

Windows 11 24H2 adds hotpatch support, a great feature that enables the installation of many security updates without a system reboot. To implement hotpatching, Microsoft is changing the layout of executable images in memory, appending new "extension pages" to the end of every hotpatchable mapped image in memory. These pages are PAGE_EXECUTE_READ.

image

Microsoft describes the change in some detail here. Here's a third-party analysis of the change showing how it breaks x64debug.

image

Unfortunately, this change affects our module stomp detection feature, which views these executable pages as patched/stomped. We are fixing this in 8.15.2. This PR lets users opt out of the change, reverting to the old behavior.

Checklist

Delete any items that are not applicable to this PR.

For maintainers

@gabriellandau gabriellandau added Team:Defend Workflows “EDR Workflows” sub-team of Security Solution v8.16.0 v8.15.2 release_note:enhancement labels Sep 10, 2024
@gabriellandau gabriellandau marked this pull request as ready for review September 11, 2024 17:29
@gabriellandau gabriellandau requested a review from a team as a code owner September 11, 2024 17:29
@elasticmachine
Copy link
Contributor

Pinging @elastic/security-defend-workflows (Team:Defend Workflows)

@gabriellandau gabriellandau enabled auto-merge (squash) September 11, 2024 17:29
@kibana-ci
Copy link
Collaborator

💛 Build succeeded, but was flaky

Failed CI Steps

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
securitySolution 19.7MB 19.7MB +822.0B

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@gabriellandau gabriellandau changed the title [Defend] Identify and exclude 24H2+ hotpatch extension pages from stomp detection [Security Solution] Identify and exclude 24H2+ hotpatch extension pages from stomp detection Sep 11, 2024
Copy link
Contributor

@paul-tavares paul-tavares left a comment

Choose a reason for hiding this comment

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

LGTM 👍

Would suggest that the PR title include something like 'add policy advanced option` just to give us here in kibana some quick context 😄

@gabriellandau gabriellandau merged commit ca0d60c into elastic:main Sep 11, 2024
43 checks passed
@kibanamachine
Copy link
Contributor

💔 All backports failed

Status Branch Result
8.15 Backport failed because of merge conflicts

Manual backport

To create the backport manually run:

node scripts/backport --pr 192490

Questions ?

Please refer to the Backport tool documentation

@gabriellandau
Copy link
Contributor Author

💚 All backports created successfully

Status Branch Result
8.15

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

gabriellandau added a commit to gabriellandau/kibana that referenced this pull request Sep 11, 2024
…mp detection (elastic#192490)

## Release Note
Defend 8.15.2 will improve support for [Windows call stack module stomp
detection](https://www.elastic.co/security-labs/upping-the-ante-detecting-in-memory-threats-with-kernel-call-stacks)
in Windows 11 24H2.

## Description
Windows 11 24H2 adds hotpatch support, a great feature that enables the
installation of many security updates without a system reboot. To
implement hotpatching, Microsoft is changing the layout of executable
images in memory, appending new "extension pages" to the end of every
hotpatchable mapped image in memory. These pages are
`PAGE_EXECUTE_READ`.

![image](https://github.com/user-attachments/assets/41bb960e-21ff-4c63-a250-81e303506ad8)

Microsoft describes the change in some detail
[here](https://techcommunity.microsoft.com/t5/windows-os-platform-blog/hotpatching-on-windows/ba-p/2959541).
Here's a [third-party analysis of the
change](https://ynwarcs.github.io/Win11-24H2-CFG) showing how it breaks
x64debug.

![image](https://github.com/user-attachments/assets/3bea1aa5-8c5a-4c27-bf74-9e92833cdc7a)

Unfortunately, this change affects our module stomp detection feature,
which views these executable pages as patched/stomped. We are fixing
this in 8.15.2. This PR lets users opt out of the change, reverting to
the old behavior.

### Checklist

Delete any items that are not applicable to this PR.

- [x] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)

### For maintainers

- [ ] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

(cherry picked from commit ca0d60c)

# Conflicts:
#	x-pack/plugins/security_solution/public/management/pages/policy/models/advanced_policy_schema.ts
@gabriellandau gabriellandau deleted the 24h2-hotpatch-module-stomp-fp branch September 12, 2024 17:38
gabriellandau added a commit that referenced this pull request Sep 12, 2024
…rom stomp detection (#192490) (#192638)

# Backport

This will backport the following commits from `main` to `8.15`:
- [[Defend] Identify and exclude 24H2+ hotpatch extension pages from
stomp detection
(#192490)](#192490)

<!--- Backport version: 8.9.8 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Gabriel
Landau","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-09-11T19:25:43Z","message":"[Defend]
Identify and exclude 24H2+ hotpatch extension pages from stomp detection
(#192490)\n\n## Release Note\r\nDefend 8.15.2 will improve support for
[Windows call stack module
stomp\r\ndetection](https://www.elastic.co/security-labs/upping-the-ante-detecting-in-memory-threats-with-kernel-call-stacks)\r\nin
Windows 11 24H2.\r\n\r\n## Description\r\nWindows 11 24H2 adds hotpatch
support, a great feature that enables the\r\ninstallation of many
security updates without a system reboot. To\r\nimplement hotpatching,
Microsoft is changing the layout of executable\r\nimages in memory,
appending new \"extension pages\" to the end of every\r\nhotpatchable
mapped image in memory. These pages
are\r\n`PAGE_EXECUTE_READ`.\r\n\r\n\r\n![image](https://github.com/user-attachments/assets/41bb960e-21ff-4c63-a250-81e303506ad8)\r\n\r\nMicrosoft
describes the change in some
detail\r\n[here](https://techcommunity.microsoft.com/t5/windows-os-platform-blog/hotpatching-on-windows/ba-p/2959541).\r\nHere's
a [third-party analysis of
the\r\nchange](https://ynwarcs.github.io/Win11-24H2-CFG) showing how it
breaks\r\nx64debug.\r\n\r\n\r\n![image](https://github.com/user-attachments/assets/3bea1aa5-8c5a-4c27-bf74-9e92833cdc7a)\r\n\r\nUnfortunately,
this change affects our module stomp detection feature,\r\nwhich views
these executable pages as patched/stomped. We are fixing\r\nthis in
8.15.2. This PR lets users opt out of the change, reverting to\r\nthe
old behavior.\r\n\r\n### Checklist\r\n\r\nDelete any items that are not
applicable to this PR.\r\n\r\n- [x] Any text added follows [EUI's
writing\r\nguidelines](https://elastic.github.io/eui/#/guidelines/writing),
uses\r\nsentence case text and includes
[i18n\r\nsupport](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)\r\n\r\n###
For maintainers\r\n\r\n- [ ] This was checked for breaking API changes
and was
[labeled\r\nappropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)","sha":"ca0d60cb042c6a46afee2297ac2715092917670f","branchLabelMapping":{"^v8.16.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:enhancement","Team:Defend
Workflows","v8.16.0","v8.15.2"],"number":192490,"url":"https://github.com/elastic/kibana/pull/192490","mergeCommit":{"message":"[Defend]
Identify and exclude 24H2+ hotpatch extension pages from stomp detection
(#192490)\n\n## Release Note\r\nDefend 8.15.2 will improve support for
[Windows call stack module
stomp\r\ndetection](https://www.elastic.co/security-labs/upping-the-ante-detecting-in-memory-threats-with-kernel-call-stacks)\r\nin
Windows 11 24H2.\r\n\r\n## Description\r\nWindows 11 24H2 adds hotpatch
support, a great feature that enables the\r\ninstallation of many
security updates without a system reboot. To\r\nimplement hotpatching,
Microsoft is changing the layout of executable\r\nimages in memory,
appending new \"extension pages\" to the end of every\r\nhotpatchable
mapped image in memory. These pages
are\r\n`PAGE_EXECUTE_READ`.\r\n\r\n\r\n![image](https://github.com/user-attachments/assets/41bb960e-21ff-4c63-a250-81e303506ad8)\r\n\r\nMicrosoft
describes the change in some
detail\r\n[here](https://techcommunity.microsoft.com/t5/windows-os-platform-blog/hotpatching-on-windows/ba-p/2959541).\r\nHere's
a [third-party analysis of
the\r\nchange](https://ynwarcs.github.io/Win11-24H2-CFG) showing how it
breaks\r\nx64debug.\r\n\r\n\r\n![image](https://github.com/user-attachments/assets/3bea1aa5-8c5a-4c27-bf74-9e92833cdc7a)\r\n\r\nUnfortunately,
this change affects our module stomp detection feature,\r\nwhich views
these executable pages as patched/stomped. We are fixing\r\nthis in
8.15.2. This PR lets users opt out of the change, reverting to\r\nthe
old behavior.\r\n\r\n### Checklist\r\n\r\nDelete any items that are not
applicable to this PR.\r\n\r\n- [x] Any text added follows [EUI's
writing\r\nguidelines](https://elastic.github.io/eui/#/guidelines/writing),
uses\r\nsentence case text and includes
[i18n\r\nsupport](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)\r\n\r\n###
For maintainers\r\n\r\n- [ ] This was checked for breaking API changes
and was
[labeled\r\nappropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)","sha":"ca0d60cb042c6a46afee2297ac2715092917670f"}},"sourceBranch":"main","suggestedTargetBranches":["8.15"],"targetPullRequestStates":[{"branch":"main","label":"v8.16.0","labelRegex":"^v8.16.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/192490","number":192490,"mergeCommit":{"message":"[Defend]
Identify and exclude 24H2+ hotpatch extension pages from stomp detection
(#192490)\n\n## Release Note\r\nDefend 8.15.2 will improve support for
[Windows call stack module
stomp\r\ndetection](https://www.elastic.co/security-labs/upping-the-ante-detecting-in-memory-threats-with-kernel-call-stacks)\r\nin
Windows 11 24H2.\r\n\r\n## Description\r\nWindows 11 24H2 adds hotpatch
support, a great feature that enables the\r\ninstallation of many
security updates without a system reboot. To\r\nimplement hotpatching,
Microsoft is changing the layout of executable\r\nimages in memory,
appending new \"extension pages\" to the end of every\r\nhotpatchable
mapped image in memory. These pages
are\r\n`PAGE_EXECUTE_READ`.\r\n\r\n\r\n![image](https://github.com/user-attachments/assets/41bb960e-21ff-4c63-a250-81e303506ad8)\r\n\r\nMicrosoft
describes the change in some
detail\r\n[here](https://techcommunity.microsoft.com/t5/windows-os-platform-blog/hotpatching-on-windows/ba-p/2959541).\r\nHere's
a [third-party analysis of
the\r\nchange](https://ynwarcs.github.io/Win11-24H2-CFG) showing how it
breaks\r\nx64debug.\r\n\r\n\r\n![image](https://github.com/user-attachments/assets/3bea1aa5-8c5a-4c27-bf74-9e92833cdc7a)\r\n\r\nUnfortunately,
this change affects our module stomp detection feature,\r\nwhich views
these executable pages as patched/stomped. We are fixing\r\nthis in
8.15.2. This PR lets users opt out of the change, reverting to\r\nthe
old behavior.\r\n\r\n### Checklist\r\n\r\nDelete any items that are not
applicable to this PR.\r\n\r\n- [x] Any text added follows [EUI's
writing\r\nguidelines](https://elastic.github.io/eui/#/guidelines/writing),
uses\r\nsentence case text and includes
[i18n\r\nsupport](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)\r\n\r\n###
For maintainers\r\n\r\n- [ ] This was checked for breaking API changes
and was
[labeled\r\nappropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)","sha":"ca0d60cb042c6a46afee2297ac2715092917670f"}},{"branch":"8.15","label":"v8.15.2","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release_note:enhancement Team:Defend Workflows “EDR Workflows” sub-team of Security Solution v8.15.2 v8.16.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants