Skip to content

fix(gateway): block HEAD (and non-POST) bounty report reads - #214

Merged
echobt merged 1 commit into
mainfrom
cursor/gateway-block-head-reports-31ed
Sep 4, 2026
Merged

fix(gateway): block HEAD (and non-POST) bounty report reads#214
echobt merged 1 commit into
mainfrom
cursor/gateway-block-head-reports-31ed

Conversation

@echobt

@echobt echobt commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Summary

Follow-up to merged #212. Greptile (T-Rex) reproduced that GET /challenge/bounty/v1/reports is 403 with no upstream call, but HEAD on the same path returned 200 and hit the operator-local service once.

is_blocked_report_read now treats every non-POST method on /v1/reports as 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/.

  • Greptile has reviewed this PR; findings are fixed or answered
  • If the bot was silent, I commented @greptileai review

Greptile 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_not
  • cargo fmt --all -- --check
  • cargo clippy -p gateway --all-targets -- -D warnings
  • cargo run -p xtask -- loc-cap
  • GitHub ci (fmt · clippy · test · deny · xtask) SUCCESS

Risk

No scoring, emission, or trust-root change. Miner POST /v1/reports is 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, …), GHCR baseintelligence/base package names, or
base-*-v1 cryptographic domain tags, unless this PR’s purpose is a coordinated
cutover documented in docs/NAMING.md.

Open in Web Open in Cursor 

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>
@cursor

cursor Bot commented Sep 4, 2026

Copy link
Copy Markdown

@greptileai review

@echobt

echobt commented Sep 4, 2026

Copy link
Copy Markdown
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-apps

greptile-apps Bot commented Sep 4, 2026

Copy link
Copy Markdown

Greptile Summary

Tightens the gateway boundary for bounty reports by rejecting every non-POST request to normalized /v1/reports paths while preserving report submission.

  • Blocks GET, HEAD, OPTIONS, PUT, PATCH, and other non-POST methods before upstream forwarding.
  • Covers report collection and item paths while keeping unrelated paths accessible.
  • Updates operator and miner documentation to describe the expanded restriction.

Confidence Score: 5/5

Safe to merge.

There are no outstanding findings.

Reviews (2): Last reviewed commit: "fix(gateway): block HEAD (and non-POST) ..." | Re-trigger Greptile

@echobt
echobt marked this pull request as ready for review September 4, 2026 12:51
@echobt
echobt merged commit 2437db9 into main Sep 4, 2026
5 checks passed
@echobt
echobt deleted the cursor/gateway-block-head-reports-31ed branch September 4, 2026 12:54
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.

2 participants