Skip to content

Define the cross-contract authorization pattern before wiring contracts together #74

Closed

Description

@joelpeace48-cell

Problem

usage-meter will call audit-registry, and payment-router will call
usage-meter. Cross-contract calls in Soroban carry subtle authorization
semantics — require_auth inside a called contract validates against the
authorization tree of the whole transaction, and it is easy to build something
that appears to check permission while actually accepting the caller's
authority as the user's.

Getting this wrong is a privilege-escalation vulnerability that unit tests will
not catch, because mocked auth passes everything.

What to do

  • Document the intended authorization tree for each cross-contract flow: who
    authorizes what, at which level.
  • Decide where require_auth_for_args is needed rather than plain
    require_auth.
  • Establish which contract is allowed to call which entrypoints, and enforce it
    — a caller allowlist, not an implicit assumption.
  • Write tests that do not use mock_all_auths, asserting that an
    unauthorized intermediate contract cannot act on a user's behalf.
  • Have the pattern reviewed by someone who did not design it.

Acceptance criteria

  • Authorization tree documented per cross-contract flow
  • Caller allowlists enforced in code
  • Tests without mock_all_auths covering escalation attempts
  • Pattern peer-reviewed and the review recorded

Notes

mock_all_auths is the single most dangerous convenience in Soroban testing —
it makes every auth test pass. Any test that is about authorization must not
use it.

Activity

  1. added
    type:securityAuth, funds, secrets, or abuse surface
    difficulty:expertFunds, auth, or consensus-critical; needs review
    priority:criticalBlocks everything else; security or build-breaking
    GrantFox OSSIssue tracked in GrantFox OSS
    on Aug 21, 2026
  2. bobo-24 commented on Aug 21, 2026

    @bobo-24

    Hi! I’m a full-stack developer with a strong blockchain background, and I’m confident I can resolve this issue quickly and effectively. I’ll deliver a clean, reliable solution with immediate attention to detail, ensuring it’s completed as soon as possible. Please assign it to me—I’m ready to get started right away.

  3. Alheriii commented on Aug 24, 2026

    @Alheriii
    Contributor

    Hi there 👋

    I’d love to pick this one up.

    For context: 200+ contributions shipped across the ecosystem, clean reviews, and I contributed to this project last wave with no dropped PRs or delays.

    I’ll add comprehensive tests for DatasetRegistry, LicenseRouter, and RoyaltySplitter — covering happy paths, authorization, edge cases, expiry, revocation, and failures.
    Aiming for >85% coverage and cargo test --all green before PR.

    Can I be assigned? Thanks!

  4. joelpeace48-cell commented on Aug 24, 2026

    @joelpeace48-cell
    ContributorAuthor

    @Alheriii you are assigned, ensure all ci pipeline are green

  5. grantfox-oss commented on Aug 24, 2026

    @grantfox-oss

    🦊 GrantFox — @Alheriii has been assigned to this issue as part of the Third Campaign campaign!

    Next steps:

    1. Open a Pull Request referencing this issue (e.g., Closes #74)
    2. Your PR will be reviewed by the FinesseStudioLab maintainers

    Good luck! Track your progress on GrantFox.

  6. grantfox-oss commented on Aug 24, 2026

    @grantfox-oss

    🎉 This issue has been marked as completed on GrantFox as part of the Third Campaign campaign!

    @Alheriii's PR #83 was approved and merged by @joelpeace48-cell.

    🏆 @Alheriii: You earned 35 FoxPoints for this contribution! Your current tier: Explorer (118 total points). Track your full progress on GrantFox.

    👏 Great work, @Alheriii! Keep contributing to FinesseStudioLab.

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

Metadata

Metadata

Assignees

Labels

GrantFox OSSIssue tracked in GrantFox OSSThird CampaignCampaign: Third Campaignarea:workspaceWorkspace, build, releasedifficulty:expertFunds, auth, or consensus-critical; needs reviewpriority:criticalBlocks everything else; security or build-breakingtype:securityAuth, funds, secrets, or abuse surface

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions