A guest user is capable of commenting on a task by using the graphql api `createWorkItemNote` operation
A guest user could comment on a task via the GraphQL API despite the UI being locked, because the API did not enforce the required permission. An attacker with guest access could post comments on tasks, bypassing the intended restriction.
GitLab
Originally disclosed on GitLab
- Fixed in 48 days
- Disclosed after 48 days
⚠️ Please read the process on how to fix security issues before starting to work on the issue. Vulnerabilities must be fixed in a security mirror.
HackerOne report #1926528 by ricardobrito on 2023-03-30, assigned to @ngeorge1:
Report | Attachments | How To Reproduce
Report
Context
Gitlab introduced in version 15.10 the ability to View system notes and add comments on tasks.
Summary
According to the interface, only project members can comment on a task, and when I visit a task as a guest user, the interface is locked:

However this can be bypassed and a guest can successfully comment on a task by using the following graphql request:
[{"operationName":"createWorkItemNote","variables":{"input":{"noteableId":"gid://gitlab/WorkItem/126000336","body":"Comment by guest","discussionId":null}},"query":"mutation createWorkItemNote($input: CreateNoteInput!) {\n createNote(input: $input) {\n note {\n id\n discussion {\n id\n notes {\n nodes {\n ...WorkItemNote\n __typename\n }\n __typename\n }\n __typename\n }\n __typename\n }\n errors\n __typename\n }\n}\n\nfragment WorkItemNote on Note {\n id\n body\n bodyHtml\n system\n internal\n systemNoteIconName\n createdAt\n lastEditedAt\n url\n lastEditedBy {\n ...User\n webPath\n __typename\n }\n discussion {\n id\n __typename\n }\n author {\n ...User\n __typename\n }\n userPermissions {\n adminNote\n awardEmoji\n readNote\n createNote\n resolveNote\n repositionNote\n __typename\n }\n __typename\n}\n\nfragment User on User {\n id\n avatarUrl\n name\n username\n webUrl\n __typename\n}\n"}]
After which the comment is successfully created. Here is a POC video with better details:
As you can see in the POC the guest is not allowed to add a comment to a task, which according to the documentation at least reporter role is needed. However, by using the API, the guest user can successfully comment.
This bug happens on gitlab.com
Impact
A guest user is capable of commenting on a task by using the graphqp api
Attachments
Warning: Attachments received through HackerOne, please exercise caution!
How To Reproduce
Please add reproducibility information to this section:
UserAcreates a project and creates an issue and then a task in the issue.UserBis added to the project as aDeveloperUserBnow add a comment to the task created in Step 1. Capture the graphql request"operationName":"createWorkItemNote"for later use.- Now
UserAchange the membership ofUserBtoGuest. Visit the task in step 1 and UI is locked to add comments. - Now replay the graphql request with a new comment added in
bodyattribute. Visit the task in step 1 and UI is still locked to add comments but the comment added in Step 4 can be seen added to the task.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the GraphQL mutation for creating work item notes did not verify that the user had the required role (reporter or higher) to comment on tasks.
Impact
A guest user could post comments on tasks, which should require at least reporter role.
What the attacker needed
A GitLab account; guest access to a project; a task in the project; ability to send GraphQL requests
How it was found
- UserA creates a project, an issue, and a task in the issue.
- UserB is added to the project as a Developer.
- UserB adds a comment to the task and captures the GraphQL request for createWorkItemNote.
- UserA changes UserB's membership to Guest; the UI is locked for commenting.
- UserB replays the captured GraphQL request with a new comment in the body; the comment is added despite the UI being locked.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
In GitLab, a guest is a user with limited permissions, such as viewing but not commenting. The web interface correctly blocked guests from commenting on tasks, but the underlying API did not check permissions properly, so a guest could still send a request to add a comment. This is a permission bypass.
What is Access control?
A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.