Skip to content

Adversarial testing suite for agent compromise scenarios #673

Description

@robertocarlous

Description

Create an adversarial testing suite that simulates agent key compromise scenarios, testing that the agent cannot escalate privileges beyond its designated permissions.

Use Case

If the agent key is compromised, the attacker should not be able to steal funds, change ownership, or modify critical configuration. This testing suite validates those guarantees.

Attack Scenarios to Test

  • Agent tries to call owner-only functions (set_caps, transfer_ownership, etc.)
  • Agent tries to withdraw user funds directly
  • Agent tries to modify contract storage directly
  • Agent tries to pause/unpause the vault
  • Agent tries to upgrade the contract
  • Agent tries to set pool addresses to drain contracts
  • Agent tries to manipulate TotalAssets arbitrarily
  • Agent tries to front-run user deposits

Acceptance Criteria

  • Comprehensive test file: test_agent_compromise_scenarios.rs
  • Each attack scenario as separate test function
  • All attacks must fail with appropriate error
  • Code coverage for all agent entry points
  • Negative test for every owner-only function
  • Document in SECURITY.md threat model

Technical Notes

  • Extend existing OwnerCompromiseBlastRadius.test.ts pattern
  • On-chain tests using Soroban test environment

Metadata

Metadata

Labels

Stellar WaveIssues in the Stellar wave programsecuritySecurity hardening, audit prep, incident response

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions