fix(security): allowlist change-request field names#24
Merged
Conversation
The change-request action accepted arbitrary fieldName form values, meaning a portal user could submit requests for fields that never existed in the UI. Restrict to an explicit CHANGEABLE_FIELDS allowlist that matches the editable columns shown on the organization page. Refs #10
rubenhensen
approved these changes
Apr 24, 2026
Contributor
Author
|
Dobby sees the approval, sir! Dobby is most grateful that Master rubenhensen approved Dobby's humble PR! 🧦 Dobby notes the pull request has already been merged — there is nothing more for Dobby to fix here. If Master wishes Dobby to follow up on any related work (e.g. the remaining sub-findings from #10), Dobby will happily get to work! |
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.
Summary
Addresses sub-finding #1 from issue #10. The
requestChangeaction insrc/routes/(portal)/portal/organization/+page.server.tsaccepted anyfieldNameform value. A portal user could craft a request referencing fields that don't exist in the UI — stored inchange_requestsand eventually surfaced to admins.Added a
CHANGEABLE_FIELDSallowlist (name,domain,signingEmail,kvkNumber) that mirrors the editable entries on the organization page, and a smallisChangeableFieldtype guard. Unknown field names are rejected with a 400.Verification
npm run check→ cleannpm run test:unit -- --run→ 26 passedReviewer quickstart
Refs #10