Fix governance auth before command decode#442
Closed
carrion256 wants to merge 1 commit into
Closed
Conversation
Contributor
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
This was referenced May 18, 2026
Collaborator
Author
Collaborator
Author
|
Closed as superseded by consolidated governance control-plane PR #427. |
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.
Fixed Findings
4ca30771-41fc-4b53-b8b2-95168b12803dSummary
execute_governanceauthorization boundary ahead of governance command body decode.require_authfailures while preserving direct public governance guards outside the bridge.Root Cause
SorobanVaultContract::execute_governancedecoded the full governance command payload before checking thatcallerwas the configured governance contract. Unauthorized callers could therefore force command-body decode/allocation before the call failed.Verification
RED before fix:
cargo test -p templar-soroban-runtime test_execute_governance_unauthorized_caller_rejected_before_body_decode -- --nocaptureleft: Err(InvalidInput),right: Err(Unauthorized), proving the malformed body decoded/failed before authorization.GREEN after fix:
cargo test -p templar-soroban-runtime test_execute_governance_unauthorized_caller_rejected_before_body_decode -- --nocapturecargo test -p templar-soroban-runtime test_execute_governance_group_membership_requires_market_id -- --nocapturecargo test -p templar-soroban-runtime --lib -- --nocapturecargo test -p templar-soroban-runtime -- --nocapturecargo fmt --checkgit diff --checkjust -f contract/vault/soroban/justfile buildjust -f contract/vault/soroban/justfile size-budget-check93782bytes /91.58 KiB<=131072bytes /128.00 KiBStack
audit/governance-abi-validation-a062/ PR fix: require governance group market id #441audit/governance-abi-validation-a056This change is