Repository navigation
security: Khao Pad v4.5.1 order-page access fix - #26
Merged
Merged
Conversation
The customer order page looked orders up by number alone whenever no ?email= was given, and order numbers are sequential — so anyone could walk KHP-2026-00001, 00002, … and read every buyer's name, email, phone and shipping address. Any signed-in account, customers included, could do the same. The return-request action and pay-by-orderNumber had the same gap. Access now needs one of: staff (admin+), the owning account (user id, or a verified email matching the order), the order's email (receipt links and /lookup), or the browser that placed the order — checkout/ start sets an HMAC-signed cookie (keyed by BETTER_AUTH_SECRET) so a guest returning from the payment page still lands on their order. Refusals are the same 404 as a missing order. Ported from bactrack-website 70d37f5, with a generic cookie name and a verified-email requirement on the account-email path. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> (cherry picked from commit 4c86687)
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.
Cherry-pick of codustry/khaopad@4c86687 (v4.5.1, codustry#220): customer order pages, return requests and pay-by-order-number now require proof of access (staff, owner, order email, or the placing browser's signed cookie). Before this, anyone could read any order's name/email/phone/address by walking sequential order numbers.
Hotfix only: no other upstream changes, no migration. Fork suite + svelte-check + build pass locally.
🤖 Generated with Claude Code