Repository navigation
fix: request only required registry write access - #100
Merged
itsfatduck merged 1 commit intoNov 10, 2026
Merged
Conversation
itsfatduck
approved these changes
Nov 10, 2026
itsfatduck
left a comment
Owner
There was a problem hiding this comment.
Thank you for this great fix! I honestly hadn't thought about how accessing more than the required permissions could lead to an Access Denied error.
I'll definitely learn from this and apply the same approach to other APIs to help prevent similar Access Denied issues in the future.
Really appreciate your contribution!
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
RegistryService.Writeopened existing keys with fullKEY_WRITE, which also requestsCreateSubKeyaccess even when the operation only sets a value. On a key whose ACL allowsSetValuebut deniesCreateSubKey, this producedAccess denied.Writes now request only
ReadKey | SetValue. Other registry operations are unchanged.Closes #99
Type of change
feat:— New optimization, customize setting, or app featurefix:— Bug fixrefactor:— Code restructuring without behavior changedocs:— Documentationtest:— Adding or fixing testsi18n:— Translation / localization updatechore:— Build, deps, CI, toolingScreenshots (if UI changes)
Not applicable; no UI changes.
Notes
Added a regression using an ACL-protected key under
HKCU\Software\TestOptimizerDuckthat permitsSetValuebut deniesCreateSubKey. It failed withAccess deniedbefore the change and passes after it. The test restores the ACL and cleans up its test keys; realDshandFeedsvalues were not modified.Validation:
RegistryServiceTests: 27 total, 0 failed, 1 skippedcsharpier check .: 302 files passedgit diff --check: passedThe reporter's Windows build 26300, elevated-only scenarios, UI execution, and upstream CI were not run locally; local validation used Windows build 26200.