Repository navigation
Conversation
Require the signed-in account ID to match the cart or order owner before reads, cart mutations, and checkout. Reject API-key requests without a member identity and prevent cross-account access, including admin tokens. Cover all six mounted routes with real stores and authenticated HTTP requests. Verify denied calls preserve owner data and legitimate owner operations retain their existing behavior. Validation: 103 Node tests and 46 Jest tests pass. Full-repository Qlty scans add no findings relative to the baseline. Signed-off-by: Nirmal Khedkar <nirmalhk7@gmail.com>
Preserve ownership checks across all six cart and order operations alongside current account security hardening. Verified 42 ownership cases, 102 Node tests and 65 Jest tests. Test-only removal of the owner guard produces 24 expected failures; all 42 cases pass with the guard restored. Signed-off-by: Nirmal Khedkar <nirmalhk7@gmail.com>
nirmalhk7
marked this pull request as ready for review
November 11, 2026 23:45
|
|
||
| const app = express(); | ||
| app.use(express.json()); | ||
| app.use(auth); |
Mount the existing API limiter before JWT authentication in the HTTP test app. Verify exhausted requests return 429 without mutating the owner cart, while retaining all ownership regressions. Validation: 43 focused HTTP cases, 103 Node tests, and 65 Jest tests pass. Syntax, hardcoded-URL, and whitespace checks pass; full Qlty comparison adds no findings. Signed-off-by: Nirmal Khedkar <nirmalhk7@gmail.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.
Cart and order routes require the signed-in account ID to match the path owner before reads, cart changes, or checkout. API keys and tokens without a member ID are denied, and an administrator role does not bypass ownership. Existing owner operations keep their response shapes and behavior.
The follow-up addresses the CodeQL finding in the ownership test app by mounting the existing API rate limiter before JWT verification. A new HTTP regression exhausts its request budget, checks HTTP 429, and confirms that a subsequent cart write leaves the owner's data unchanged. Production handlers, dependencies, rate-limit settings, pricing, settlement, escrow, and stock-reservation policies are unchanged. Cart and order stores remain in memory.
Verification on the updated branch:
cd backend && npm testpasses 103 Node tests and 65 Jest tests across 25 Jest suites../scripts/list-hardcoded-urls.sh, and patch whitespace checks pass.The contribution follows the fork/PR and per-commit DCO requirements in NTARI's Bug-Build-Test guide. No JFA conformance binding changes or deployment verification are claimed. Hosted CodeQL must confirm the alert is cleared on the published head, and independent human review remains required. The author must not merge this PR.