Skip to content

[Security] agent_registry register_transaction and complete_transaction are unauthenticated, letting reputation be fabricated #77

Description

@david87131

Why this matters

In agent.rs, register_transaction never calls require_auth on anyone, so any caller can create AgentTransaction records with attacker-chosen agent and parties. complete_transaction only compares the supplied agent to stored state but never calls agent.require_auth, so anyone can complete on the agent's behalf and bump completed_agreements. Combined with rate_agent (no rater != agent guard), one actor can manufacture transactions, complete them, and rate any verified agent at will.

Acceptance criteria

  • register_transaction authenticates a legitimate party and validates parties are distinct/real
  • complete_transaction calls require_auth on the agent or authorized completing party
  • rate_agent rejects self-rating and only allows a real party of a completed transaction to rate, once
  • Tests assert a non-party cannot register, complete, or rate, and an agent cannot rate itself

Files to touch

  • contracts/agent_registry/src/agent.rs

Out of scope

  • Weighting reputation by transaction value
  • Cross-contract verification against the rental contract

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardOfficial CampaignCampaign: Official CampaignbugSomething isn't workingcriticalHigh-impact, hard issue (security, correctness or architecture) - prioritizehelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions