Skip to content

Conversation

@FloDwld
Copy link
Contributor

@FloDwld FloDwld commented Nov 4, 2025

This pull request fixes several security issues exploitable by low-privileged and unauthenticated users by adding missing authorization checks:

  • IDP service: Restrict deleting and updating IDP providers to host users. Additionally, only disclose the client secret to host users.
  • User service: Prevent registrations when setting "Disallow user registration" is active.
  • Memo Attachment service: Restrict setting attachments to own memos.
  • Memo Relation service: Restrict setting memo relations to own memos.
  • Reaction service: Restrict deletion of reactions to own reactions.

@FloDwld FloDwld requested a review from boojack as a code owner November 4, 2025 08:13
@FloDwld
Copy link
Contributor Author

FloDwld commented Nov 4, 2025

I've added a commit to fix the failing tests

@boojack boojack requested a review from Copilot November 5, 2025 00:49
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR enhances security and access control across multiple API endpoints by adding authentication checks, permission validations, and sensitive data redaction.

Key Changes:

  • Added user registration control based on workspace settings with superuser bypass
  • Implemented authentication and authorization checks for memo-related operations
  • Added client secret redaction for non-host users when retrieving identity providers

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
server/router/api/v1/user_service.go Adds workspace setting check to control user registration with superuser override
server/router/api/v1/reaction_service.go Adds authentication and ownership validation for deleting memo reactions
server/router/api/v1/memo_relation_service.go Adds authentication and ownership validation for setting memo relations
server/router/api/v1/memo_attachment_service.go Adds authentication and ownership validation for setting memo attachments
server/router/api/v1/idp_service.go Adds authentication checks for update/delete operations and client secret redaction based on user role
server/router/api/v1/test/idp_service_test.go Updates tests to use authenticated contexts and validates client secret redaction behavior

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@boojack
Copy link
Member

boojack commented Nov 5, 2025

@claude

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants