Conversation
🟡 Please give this pull request extra attention during review.This pull request introduces multiple high-confidence IDOR vulnerabilities in notification-related GraphQL mutations, where users can potentially access, modify, or delete notifications belonging to other users due to a complete lack of authorization checks in the DeleteNotification and MarkNotificationAsRead mutations.
|
| Vulnerability | Potential IDOR Vulnerability |
|---|---|
| Description | This code represents a potential IDOR vulnerability because it lacks user authorization checks when retrieving and modifying a notification. The mutation simply finds a notification by ID without verifying that the current user has the right to access or modify that specific notification. An attacker could potentially manipulate the notification ID to read or modify notifications belonging to other users. |
⚠️ Potential IDOR Vulnerability in app/graphql/mutations/notifications/delete_notification.rb
| Vulnerability | Potential IDOR Vulnerability |
|---|---|
| Description | This code represents a potential Insecure Direct Object Reference (IDOR) vulnerability because it allows deletion of a notification by ID without verifying the requester's ownership or authorization. The resolve method simply finds a notification by ID and attempts to destroy it, with no checks to ensure the current user has the right to delete that specific notification. This could allow an attacker to delete notifications belonging to other users by guessing or enumerating notification IDs. |
✨ Code Policies (3)
| Policy | graphql-auth-check |
|---|---|
| Result | The new mutations (DeleteNotification and MarkNotificationAsRead) bypass authentication by not implementing the authorization checks available in BaseMutation. While BaseMutation provides an 'authorize' method for implementing authentication checks, neither mutation uses it, allowing unrestricted access to delete or modify any notification by ID. |
| Policy | Auth Policy at Acme |
|---|---|
| Result | The changes do not properly enforce authorization. The mutations allow direct access to notifications by ID without any authorization checks, violating the requirement to use the AllGood authorization library. Neither mutation implements authorization checks through BaseMutation's authorize method or uses AllGood.authorize! as required. This creates potential IDOR vulnerabilities by allowing any user to delete or mark as read any notification without permission verification. |
| Policy | auth-check |
|---|---|
| Result | The changes appear to bypass authentication. While the BaseMutation class has an 'authorize' method available, neither DeleteNotification nor MarkNotificationAsRead mutations implement any authentication or authorization checks. The mutations allow direct access to find and modify notifications without verifying the user's authentication status or authorization to access these specific notifications. The base class's authorize method is optional and must be explicitly called, but it is not being used in either mutation. |
💭 Unconfirmed Findings (3)
| Vulnerability | Potential Injection via Unvalidated Notification ID |
|---|---|
| Description | In the delete_notification.rb file, the find_by method uses a notification ID parameter without proper sanitization, which could enable SQL injection attacks by allowing malicious manipulation of database queries. |
| Vulnerability | Potential Authorization Bypass |
|---|---|
| Description | The delete_notification.rb mutation lacks explicit authorization checks, potentially allowing users to delete notifications that do not belong to them, which represents a significant security risk. |
| Vulnerability | Potential Unauthorized Notification Access |
|---|---|
| Description | In the mark_notification_as_read.rb mutation, there are no authentication or authorization checks, enabling users to modify notification states without proper verification of their permissions. |
All finding details can be found in the DryRun Security Dashboard.
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.
No description provided.