Improper Authorization Leads to Editor can toggle admin-only workspace features (Lovable AI)
An Editor role user could call an API endpoint to disable the workspace-wide Lovable AI feature, which is intended to be admin-only. This allowed a lower-privileged user to disrupt AI-driven functionality for all workspace members.
- Fixed in 6 hours
- Disclosed after 30 days
Summary:
An account with the Editor role can successfully call the API endpoint /workspaces/<WORKSPACE_ID>/tool-preferences/ai_gateway/enablethat disables workspace-wide admin-only feature (Lovable AI). The API does not enforce server-side role checks for this action, allowing a vertical privilege escalation (Broken Access Control).
Steps To Reproduce:
Preconditions
-
Two accounts are members of the same workspace
Victim-Workspace:- Account A (Owner/Admin) - Owner role in
Victim-Workspace. - Account B (Editor) - Editor role in the same
Victim-Workspace.
- Account A (Owner/Admin) - Owner role in
-
Sign in as Account A (Admin) and toggle the AI feature off inside the workspace.
-
Capture this endpoint (Responsible for Disabling AI Feature).
POST /workspaces/<WORKSPACE_ID>/tool-preferences/ai_gateway/enable HTTP/2
Host: lovable-api.com
Authorization: Bearer <OWNER-TOKEN>
Content-Type: application/json
{"approval_preference":"disable"}
Note: <WORKSPACE_ID> is the workspace id for Victim-Workspace.
- Modify request to use Editor JWT Token
- Replace the Authorization header with Account B (Editor) JWT:
POST /workspaces/<WORKSPACE_ID>/tool-preferences/ai_gateway/enable HTTP/2
Host: lovable-api.com
Authorization: Bearer <EDITOR_JWT>
Content-Type: application/json
{"approval_preference":"disable"}
- When the request is sent again with the Editor's JWT , the request succeeds and the Lovable AI setting is switched off for the workspace.
Proof of Concept:
Impact
Based on the Lovable AI documentation, this feature powers all the AI-driven parts of a workspace like prompt integrations, content generation, and other model-based actions.
If an Editor disables it, all those AI features stop working across the workspace, breaking functionality for every member. Since only admins are supposed to control this setting, the bug lets an unauthorized user disrupt how the workspace operates and remove core features that teams rely on.
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 API endpoint lacks a server-side role check, allowing any authenticated workspace member to modify the admin-only tool preference.
Impact
An Editor could disable workspace-wide AI features, disrupting functionality for all members, though the impact is limited to availability and does not involve data access.
What the attacker needed
Two accounts in the same workspace; One account with Editor role; One account with Owner/Admin role
The fix
The endpoint should enforce a server-side role check to ensure only workspace admins can modify the AI gateway preference.
How it was found
- Sign in as the admin account and toggle the AI feature off inside the workspace.
- Capture the request to the endpoint responsible for disabling the AI feature.
- Replace the Authorization header with the Editor account's JWT token.
- Send the modified request; it succeeds and the AI setting is switched off for the workspace.
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 many apps, different users have different roles, like admin or editor. The app is supposed to check that only admins can change certain settings. Here, the server did not check the user's role when an editor sent a request to turn off an AI feature, so the editor could change an admin-only setting.
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.