Repository navigation
Fix checkout privilege escalation and user authorization vulnerabilities - #40
Merged
aelassas merged 1 commit intoOct 24, 2026
Merged
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
aelassas
added a commit
that referenced
this pull request
Oct 24, 2026
aelassas
added a commit
that referenced
this pull request
Oct 24, 2026
aelassas
added a commit
that referenced
this pull request
Oct 24, 2026
aelassas
added a commit
that referenced
this pull request
Oct 24, 2026
fix(frontend): non autenticated pay later checkout success page broken
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.
🔒 Security Fix: Checkout Privilege Escalation & User Authorization
📌 Summary
This PR fixes privilege escalation and broken authorization in checkout and user-management endpoints.
Previously, unauthenticated checkout could create accounts from client-supplied renter data, including privileged account fields. In addition, password and profile updates did not consistently restrict access based on the authenticated user’s role and relationship to the target account.
🚨 Problems & Root Cause
renterobject to theUsermodel. A client could submit a privileged account type or other security-sensitive fields.updateandchangePasswordauthorization checks did not explicitly deny Agency access to Admin targets.changePasswordtrusted the client-providedstrictflag, allowing a user to skip current-password verification by sendingstrict: false.blacklistedchanges without restricting them to Admins.🛡️ Solution & Implementation Details
fullName,email,phone,birthDate, andlanguage.Useraccounts, with verification and blacklist state set by the server. Client-supplied role, agency, password, and other unapproved fields are not persisted.strictvalue.🧪 Regression Tests Added
Added regression coverage in
backend/__tests__/booking.test.tsandbackend/__tests__/user.test.tsverifying that:strict: falsecannot bypass current-password verification for self-service changes.🔍 Verification & Test Results
npm.cmd run build— passed.Closes #38