Repository navigation
Conversation
… it (N55) POST /api/batches/shared checked no identity. Any authenticated key could publish a priced shared batch (its slots and its price per slot) under another operator's kernel, so buyers claiming those slots would believe that operator had made the offer. A shared batch is the kernel operator's offer, so the route now applies the kernel-operator check that routes/lob.ts and routes/carrier.ts use: - no caller (req.operatorId ?? req.userId, trimmed): 401 unauthenticated; - an unknown kernel: 404 kernel_not_found (502 kernel_lookup_failed if the lookup itself fails); - a kernel with no operator, or the zero address: 403 kernel_unowned; - a caller who is not the kernel's operator (compared case-insensitively): 403 not_kernel_operator. Tests: shared-batch-owner.test.ts has 8 tests. Five fail on master 7d688ce, where a stranger, an unknown kernel, a zero-operator kernel, no identity and a blank identity all got 200. All 8 pass now. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KBTXKQ2uqtcrsUtPnQdtf8
Owner
Author
|
Closing this in favour of #403 (readmodels), by agreement with the steward (bus #5435/#5438) and readmodels (#5227/#5436). The cross-family review of this PR found the route check fails closed, but the identity it trusts ( 🤖 Generated with Claude Code |
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.
N55: only a kernel's operator may create a shared batch on it
The hole (live on master 7d688ce).
POST /api/batches/sharedchecked no identity. Any authenticated key could publish a priced shared batch (slots and price per slot) under another operator's kernel. Buyers claiming its slots would believe that operator made the offer.The fix is the kernel-operator check from
routes/lob.tsandroutes/carrier.ts:req.operatorId ?? req.userId, trimmed): 401unauthenticated.kernel_not_found(502kernel_lookup_failedif the lookup itself fails).kernel_unowned.not_kernel_operator.Tests:
shared-batch-owner.test.ts, 8 tests. 5 fail on master: the stranger, unknown-kernel, zero-operator, no-identity and blank-identity cases all got 200. Gateway tsc is clean. The full gateway suite has 3714 passed, 13 skipped and 1 failure, innegotiation-settlement-correctness.test.ts. That test passes alone 3 times out of 3, both with this change and with master'sbatches.ts, so it's a full-run flake and not this change.Merge order: this is an ownership guard, so it merges after WP-A (#326) under rule 6. #375 (N49) rewrites the same file, so whichever merges second takes a small rebase. Both PRs are refvertical's.
Callers: the dashboard's BatchBoardPage creates shared batches with the signed-in user's key. After this change only the kernel's operator can create one on that kernel, which is the intent.
Board row N55 (refvertical).
🤖 Generated with Claude Code
https://claude.ai/code/session_01KBTXKQ2uqtcrsUtPnQdtf8