fix(stellar_analytics): require requester auth and data-owner consent in request_analysis - #409
Merged
akordavid373 merged 1 commit intoAug 18, 2026
Conversation
… 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #387 —
StellarAnalytics::request_analysishad two authorization gaps:requesteras a plain argument and never calledrequester.require_auth(), so anyone could pass a victim's address and drain that victim's privacy budget (griefing/DoS).require_consentprivacy levels, the consent check was a no-op comment, so restricted datasets could be analyzed without the data owner's consent.Changes
request_analysisnow callsrequester.require_auth()before any budget check or deduction.privacy_level.require_consentistrue, the contract looks up the dataset'suploader(the data owner) and requires their authorization viauploader.require_auth().test_request_analysis_rejects_spoofed_requestertest_request_analysis_requires_data_owner_consentVerification
cargo fmt --check— cleancargo test— allstellar_analyticstests pass, including the two new tests (the 7 pre-existingonchain_aggregator_testsfailures are unrelated and were failing before this change)Closes #387