Expose organization details and email updates - #184
Open
doobneek wants to merge 5 commits into
Open
Conversation
There was a problem hiding this comment.
Cannot safely approve due to a privacy/access-control regression: organization email can be fetched without authorization via the new organization detail endpoint.
Blocking issues
- Privacy/access-control issue:
GET /organizations/:organizationIdis publicly reachable (onlygetUsermiddleware) and returns fullOrganizationviafindByPk, includingemail(src/routes.js,src/controllers/organizations.js). The new test explicitly validates unauthenticated email exposure (test/integration/get-organizations.test.js). This is a blocking PII exposure risk.
There was a problem hiding this comment.
The PR correctly removes organization emails from public list/location payloads, but it introduces a new endpoint that appears to re-expose email without clear authorization guarantees.
Blocking issues
- Potential privacy/access-control regression:
GET /organizations/:organizationId(added insrc/routes.jsand implemented insrc/controllers/organizations.js) returns the full organization record includingemail, but it is not protected bydataEntryAuthor any organization-level authorization check. IfgetUseris optional/permissive in this codebase, this enables email harvesting by ID enumeration. - Missing risky auth tests: there are no integration tests asserting unauthenticated/unauthorized behavior for
GET /organizations/:organizationId(e.g., 401/403 expectations). Given this endpoint returns previously-hidden PII (email), auth behavior must be explicitly tested before approval.
There was a problem hiding this comment.
Not safe to approve as-is due to an access-control gap introduced around organization email updates.
Blocking issues
- High severity (auth/integrity):
PATCH /organizations/:organizationIdnow allows updatingemail(src/controllers/organizations.js), but the route still has no organization-level authorization check (src/routes.jsuses onlygetUser+dataEntryAuth). In production, any authenticated user can modify any organization’s private contact email. - Risky logic lacks protective tests: new tests cover email format/trim behavior, but there is no integration test asserting unauthorized users cannot update another organization’s email (or organization record) via
PATCH /organizations/:organizationId.
Author
|
Addressed all bot comments in the current head commit.
|
doobneek
dismissed stale reviews from github-actions[bot] and github-actions[bot]
March 10, 2026 01:21
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.
Supersedes #176.
Summary