[ER] Fix a soundness hole in parameter access#230
Merged
vswarte merged 4 commits intovswarte:mainfrom Feb 21, 2026
Merged
Conversation
As discussed on Discord, providing non-`unsafe` access to parameters through `SoloParamRepository` (even immutable access) while also providing mutable access through `FD4ParamRepository` is a soundness hole unless we explicitly require that only one of these singletons be accessed at a time. This fixes the issue by making access via `FD4ParamRepository` require an `unsafe` block with the condition that no other parameters have access. For a detailed account of why we went this direction, see the comment on `FD4ParamRepository`.
vswarte
reviewed
Feb 18, 2026
vswarte
reviewed
Feb 19, 2026
| .find_index(param_id) | ||
|
|
||
| // Double-check that the parameter we found is the one we're epxecting. | ||
| if res_cap.matches_param::<P>() { |
Collaborator
Author
There was a problem hiding this comment.
Changed to a debug-only assert
axd1x8a
approved these changes
Feb 21, 2026
vswarte
approved these changes
Feb 21, 2026
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.
As discussed on Discord, providing non-
unsafeaccess to parameters throughSoloParamRepository(even immutable access) while also providing mutable access throughFD4ParamRepositoryis a soundness hole unless we explicitly require that only one of these singletons be accessed at a time.This fixes the issue by making access via
FD4ParamRepositoryrequire anunsafeblock with the condition that no other parameters have access. For a detailed account of why we went this direction, see the comment onFD4ParamRepository.