-
Notifications
You must be signed in to change notification settings - Fork 263
Fix issues related to MSRC case #110341; update packages per CVE-2026-33186 #3422
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
Open
adreed-msft
wants to merge
9
commits into
main
Choose a base branch
from
adreed/10.32.3
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
d4f72ec
disable network iso
wonwuakpa-msft 2ee49b7
Update offending packages
adreed-msft 3c3aec8
Correct issues re: MSRC case #110341
adreed-msft cf82e2e
Alter intentional panics to return errors
adreed-msft f314f11
Changelog
adreed-msft 704718e
Add test to validate changes
adreed-msft 3d4ada9
Satiate the clanker
adreed-msft 5bd126e
Error formatting
adreed-msft e3c0e0c
version.go
adreed-msft File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,103 @@ | ||
| //go:build linux | ||
| // +build linux | ||
|
|
||
| package sddl | ||
|
|
||
| import ( | ||
| "math" | ||
| "testing" | ||
| "unsafe" | ||
|
|
||
| "github.com/stretchr/testify/assert" | ||
| ) | ||
|
|
||
| func TestMaliciousRelativeSDDLCrashPrevented(t *testing.T) { | ||
| a := assert.New(t) | ||
|
|
||
| craftedDescriptor := SECURITY_DESCRIPTOR_RELATIVE{ | ||
| Revision: SDDL_REVISION, | ||
| Sbz1: 0, // must be zero | ||
| Control: SE_SELF_RELATIVE, | ||
| Data: [0]BYTE{}, | ||
| } | ||
|
|
||
| type testTargets struct { | ||
| testName string | ||
| offset *DWORD | ||
| offsetValue DWORD | ||
| controlFlag SECURITY_DESCRIPTOR_CONTROL | ||
| siFlags SECURITY_INFORMATION | ||
| } | ||
|
|
||
| maliciousOffsetSID := DWORD(math.MaxUint32 - unsafe.Sizeof(SID{}) + 1) | ||
| maliciousOffsetACL := DWORD(math.MaxUint32 - unsafe.Sizeof(ACL{}) + 1) | ||
|
|
||
| fieldsToTest := []testTargets{ | ||
| {"DACL", &craftedDescriptor.OffsetDacl, maliciousOffsetACL, SE_DACL_PRESENT | SE_SELF_RELATIVE, DACL_SECURITY_INFORMATION}, | ||
| {"SACL", &craftedDescriptor.OffsetSacl, maliciousOffsetACL, SE_SACL_PRESENT | SE_SELF_RELATIVE, SACL_SECURITY_INFORMATION}, | ||
| {"Owner", &craftedDescriptor.OffsetOwner, maliciousOffsetSID, SE_SELF_RELATIVE, OWNER_SECURITY_INFORMATION}, | ||
| {"Group", &craftedDescriptor.OffsetGroup, maliciousOffsetSID, SE_SELF_RELATIVE, GROUP_SECURITY_INFORMATION}, | ||
| } | ||
|
|
||
| //sdRelativeIsValid() | ||
| for _, v := range fieldsToTest { | ||
| // take note of the original values of the fields we're updating. | ||
| originalOffset := *v.offset | ||
| originalControl := craftedDescriptor.Control | ||
|
|
||
| // Update our offset and control bits. | ||
| *v.offset = v.offsetValue | ||
| craftedDescriptor.Control = v.controlFlag | ||
|
|
||
| // Run sdRelativeIsValid inside a closure | ||
| // so that we can validate that it did not crash, and errored appropriately. | ||
| panicked, err := func() (panicked any, err error) { | ||
| defer func() { | ||
| panicked = recover() | ||
| }() | ||
|
|
||
| // Goland thinks these byte typecasts are redundant. They are not! | ||
| //goland:noinspection GoRedundantConversion | ||
| descData := ([]byte)(unsafe.Slice((*byte)(unsafe.Pointer(&craftedDescriptor)), unsafe.Sizeof(craftedDescriptor))) | ||
|
|
||
| err = sdRelativeIsValid(descData, v.siFlags) | ||
|
|
||
| return | ||
| }() | ||
|
|
||
| // reset our flags | ||
| *v.offset = originalOffset | ||
| craftedDescriptor.Control = originalControl | ||
|
|
||
| // We should not have panicked, just errored cleanly. | ||
| a.Nil(panicked, v.testName, "panicked") | ||
| a.NotNil(err, v.testName, "should have returned an error") | ||
| a.Contains(err.Error(), "must lie within sd", v.testName, "error wasn't as expected") | ||
| } | ||
|
|
||
| // let's test one more thing. getDaclString could cause issues in the past, let's set the malicious data for that and make sure we error. | ||
| craftedDescriptor = SECURITY_DESCRIPTOR_RELATIVE{ | ||
| Revision: SDDL_REVISION, | ||
| Sbz1: 0, // must be zero | ||
| Control: SE_SELF_RELATIVE | SE_DACL_PRESENT, | ||
| OffsetDacl: maliciousOffsetACL, | ||
| Data: [0]BYTE{}, | ||
| } | ||
|
|
||
| panicked, err := func() (panicked any, err error) { | ||
| defer func() { | ||
| panicked = recover() | ||
| }() | ||
|
|
||
| // Goland thinks these byte typecasts are redundant. They are not! | ||
| //goland:noinspection GoRedundantConversion | ||
| descData := ([]byte)(unsafe.Slice((*byte)(unsafe.Pointer(&craftedDescriptor)), unsafe.Sizeof(craftedDescriptor))) | ||
|
|
||
| _, err = getDaclString(descData) | ||
| return | ||
| }() | ||
|
|
||
| a.Nil(panicked, "getDaclString panicked") | ||
| a.NotNil(err, "getDaclString should error") | ||
| a.Contains(err.Error(), "points outside Security Descriptor of size", "getDaclString error wasn't what was expected") | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.