Skip to content

fix(stellar_analytics): require requester auth and data-owner consent in request_analysis - #409

Merged
akordavid373 merged 1 commit into
connect-boiz:mainfrom
oche11207-art:fix/issue-387-request-analysis-auth
Aug 18, 2026
Merged

fix(stellar_analytics): require requester auth and data-owner consent in request_analysis#409
akordavid373 merged 1 commit into
connect-boiz:mainfrom
oche11207-art:fix/issue-387-request-analysis-auth

Conversation

@oche11207-art

@oche11207-art oche11207-art commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes #387StellarAnalytics::request_analysis had two authorization gaps:

  1. Spoofable requester — it accepted requester as a plain argument and never called requester.require_auth(), so anyone could pass a victim's address and drain that victim's privacy budget (griefing/DoS).
  2. Bypassed consent — for require_consent privacy levels, the consent check was a no-op comment, so restricted datasets could be analyzed without the data owner's consent.

Changes

  • request_analysis now calls requester.require_auth() before any budget check or deduction.
  • When privacy_level.require_consent is true, the contract looks up the dataset's uploader (the data owner) and requires their authorization via uploader.require_auth().
  • Added two explicit-auth regression tests:
    • test_request_analysis_rejects_spoofed_requester
    • test_request_analysis_requires_data_owner_consent

Verification

  • cargo fmt --check — clean
  • cargo test — all stellar_analytics tests pass, including the two new tests (the 7 pre-existing onchain_aggregator_tests failures are unrelated and were failing before this change)

Closes #387

… in request_analysis

`request_analysis` accepted a plain `requester` argument without calling
`require_auth()`, so any caller could spoof a victim's address and drain
their privacy budget. It also treated the `require_consent` check as a
no-op comment, letting restricted datasets be analyzed without consent.

- Call `requester.require_auth()` before any budget check or deduction.
- For `require_consent` privacy levels, require the dataset uploader (the
  data owner) to authorize the request.
- Add explicit-auth tests for a spoofed requester and a missing data-owner
  consent signature.

Closes connect-boiz#387

Generated with Codebuff 🤖
Co-Authored-By: Codebuff <noreply@codebuff.com>
@akordavid373
akordavid373 merged commit 8efbffe into connect-boiz:main Aug 18, 2026
8 checks passed
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.

StellarAnalytics request_analysis: spoofable requester argument drains victims' privacy budgets

2 participants