Skip to content

Fix governance list input validation#444

Closed
carrion256 wants to merge 1 commit into
audit/governance-abi-validation-a056from
audit/governance-abi-validation-a066
Closed

Fix governance list input validation#444
carrion256 wants to merge 1 commit into
audit/governance-abi-validation-a056from
audit/governance-abi-validation-a066

Conversation

@carrion256

@carrion256 carrion256 commented May 18, 2026

Copy link
Copy Markdown
Collaborator

Summary

Fixes A-066 / Nexus b7898751-488c-4530-a728-d980d83b8a53.

This PR makes the vault/governance list-input policy explicit:

  • rejects duplicate Soroban governance config address lists for guardians, allocators, and allowed adapters in the runtime execute_governance application path;
  • rejects duplicate supply-queue target_ids at governance submit_set_supply_queue time, before a misleading pending proposal can be queued;
  • preserves empty-list semantics where they are already meaningful:
    • guardians and allocators store an empty list (clear effective configured role members),
    • allowed adapters removes the optional adapter binding config,
    • empty supply queue remains an explicit clear/disable-auto-allocation proposal.

Fixed Findings

  • A-066 — Nexus b7898751-488c-4530-a728-d980d83b8a53
    • Root cause: list-like governance inputs had mixed implicit behavior: runtime supply queue already rejected duplicates, but governance submission still accepted duplicate supply-queue IDs, and runtime governance config address lists accepted duplicate account/address entries.
    • Fix commit: 26cc9a99719790c634ffedf3c5a86cb96cc816ae
    • Files:
      • contract/vault/soroban/governance/src/lib.rs
      • contract/vault/soroban/governance/src/tests.rs
      • contract/vault/soroban/src/contract/entrypoints.rs
      • contract/vault/soroban/src/tests.rs

Verification

RED evidence observed before fix:

  • cargo test -p templar-soroban-runtime test_governance_config_rejects_duplicate_address_lists -- --nocapture
    • failed with duplicate config address list returning Ok(Ok(())) instead of Err(Ok(InvalidInput)).
  • cargo test -p templar-soroban-governance submit_set_supply_queue_rejects_duplicate_targets -- --nocapture
    • failed with duplicate supply-queue targets returning Ok(1) instead of Err(InvalidInput).

GREEN verification:

  • cargo test -p templar-soroban-runtime test_governance_config_rejects_duplicate_address_lists -- --nocapture
  • cargo test -p templar-soroban-runtime test_governance_config_empty_lists_keep_clear_semantics -- --nocapture
  • cargo test -p templar-soroban-governance submit_set_supply_queue_rejects_duplicate_targets -- --nocapture
  • cargo test -p templar-soroban-governance submit_set_supply_queue_allows_empty_clear_policy -- --nocapture
  • cargo test -p templar-soroban-governance cap_action_is_timelocked_and_accepts_after_maturity -- --nocapture
  • cargo test -p templar-soroban-runtime --lib -- --nocapture
  • cargo test -p templar-soroban-governance -- --nocapture
  • just -f contract/vault/soroban/justfile size-budget-check
    • runtime deploy artifact: 93969 bytes (91.77 KiB) <= 131072 bytes
  • post-commit hook reran just -f contract/vault/soroban/justfile size-budget-check
    • passed at 93969 bytes

Stack

Base: audit/governance-abi-validation-a056 / PR #442.


This change is Reviewable

…980d83b8a53)

Reject duplicate Soroban governance config address lists in the runtime application path and duplicate supply-queue target IDs at governance submission. Empty list inputs remain explicit clear semantics for configurable lists and supply queues.

Verification:

- cargo test -p templar-soroban-runtime test_governance_config_rejects_duplicate_address_lists -- --nocapture

- cargo test -p templar-soroban-runtime test_governance_config_empty_lists_keep_clear_semantics -- --nocapture

- cargo test -p templar-soroban-governance submit_set_supply_queue_rejects_duplicate_targets -- --nocapture

- cargo test -p templar-soroban-governance submit_set_supply_queue_allows_empty_clear_policy -- --nocapture

- cargo test -p templar-soroban-runtime --lib -- --nocapture

- cargo test -p templar-soroban-governance -- --nocapture

- just -f contract/vault/soroban/justfile size-budget-check (runtime deploy 93969 bytes)
@coderabbitai

coderabbitai Bot commented May 18, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: a55db1cf-8c3d-41e1-8377-f709f441cd21

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch audit/governance-abi-validation-a066

Comment @coderabbitai help to get the list of available commands and usage tips.

@carrion256

Copy link
Copy Markdown
Collaborator Author

Superseded by consolidated governance control-plane PR #427. The relevant commits/findings from this PR have been folded into #427 and verified there.

@carrion256

Copy link
Copy Markdown
Collaborator Author

Closed as superseded by consolidated governance control-plane PR #427.

@carrion256 carrion256 closed this May 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant