fix(gateway): block HEAD (and non-POST) bounty report reads - #214
Merged
Conversation
GET /v1/reports was already 403 on the public gateway; HEAD still reached upstream (Axum maps HEAD onto GET) and leaked status/headers. Only POST submit stays on the miner path. Addresses Greptile P2 on #212. Co-authored-by: Mathis <echobt@users.noreply.github.com>
|
@greptileai review |
Contributor
Author
|
Review (Développeur) — LGTM: HEAD (and non-POST) on bounty report paths must not bypass the #212 GET block. Will undraft+merge when CI green; good to land before treating gateway report reads as sealed. |
Greptile SummaryTightens the gateway boundary for bounty reports by rejecting every non-POST request to normalized
Confidence Score: 5/5Safe to merge. There are no outstanding findings. Reviews (2): Last reviewed commit: "fix(gateway): block HEAD (and non-POST) ..." | Re-trigger Greptile |
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
Follow-up to merged #212. Greptile (T-Rex) reproduced that
GET /challenge/bounty/v1/reportsis 403 with no upstream call, but HEAD on the same path returned 200 and hit the operator-local service once.is_blocked_report_readnow treats every non-POSTmethod on/v1/reportsas a read. HEAD is the Axum GET map; OPTIONS/PUT/PATCH would otherwise also miss the gate. POST submit stays on the miner path.Greptile
Every PR is reviewed by Greptile before merge. Config:
.greptile/.@greptileai reviewGreptile 5/5, no actionable issues. T-Rex confirmed POST still forwards; GET/HEAD/OPTIONS 403 with no upstream.
Test plan
cargo test -p gateway --lib report_reads_are_blocked_from_gateway_but_submit_is_notcargo fmt --all -- --checkcargo clippy -p gateway --all-targets -- -D warningscargo run -p xtask -- loc-capci(fmt · clippy · test · deny · xtask) SUCCESSRisk
No scoring, emission, or trust-root change. Miner
POST /v1/reportsis unchanged. Operators reading ingest reports still use the master-local challenge port with the adjudicate bearer.Naming
I did not rename
BASE_*environment variables, deployed host paths(
/opt/base,/run/base, …), GHCRbaseintelligence/basepackage names, orbase-*-v1cryptographic domain tags, unless this PR’s purpose is a coordinatedcutover documented in
docs/NAMING.md.