fix(miner-ui): restrict run-state API to loopback#4982
Conversation
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
|
Warning 🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨 ⏸️ Gittensory review result - manual review recommendedReview updated: 2026-07-11 17:26:54 UTC
⏸️ Suggested Action - Manual Review
Review summary Nits — 5 non-blocking
Concerns raised — review before merging
Review context
Contributor next steps
Signal definitions
[BETA] Chat with GittensoryAsk Gittensory a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.
Full command reference: https://gittensory.aethereal.dev/docs/gittensory-commands Visual preview
Click any thumbnail to open the full-size screenshot. Before = production · After = this PR's preview deploy. 🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers.
|
18ee35a to
a663fef
Compare

Motivation
GET /api/run-stateunauthenticated, leaking local miner run-state rows to any client that can reach the dev server.Description
isLoopbackAddress()and returning403for non-loopback remote addresses before loading or touching the local run-state module inapps/gittensory-miner-ui/vite-run-state-api.ts.req.socket?.remoteAddressinto the extracted handler so remote address checks run on dev/preview requests.apps/gittensory-miner-ui/src/run-state-api.test.tsthat assert non-loopback clients are denied without loading the store and that IPv6-mapped loopback addresses are allowed.[]if the DB file is absent) and the read-only behavior for loopback clients.Testing
npm --workspace @jsonbored/gittensory-miner-ui exec -- vitest run src/run-state-api.test.ts, and all tests passed.npm --workspace @jsonbored/gittensory-miner-ui run typecheckcompleted successfully andeslintran without errors (only existing warnings surfaced) vianpm --workspace @jsonbored/gittensory-miner-ui run lint.git diff --checkproduced no trailing whitespace or conflict markers, whilenpm audit --audit-level=moderatefailed due to the registry returning403 Forbidden(network/registry issue), not a local dependency advisory.Codex Task