Bug: EnvVar/Label/Volume/Port deletion does not verify resource belongs to the app in URL (IDOR) #3
Labels
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: sneak/upaas#3
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Description
The delete handlers for env vars, labels, volumes, and ports (e.g.,
HandleEnvVarDelete) look up the resource by its own ID but never verify that the resource'sAppIDmatches the{id}parameter in the URL path. This means a user can delete resources belonging to other apps by manipulating the resource ID.Impact
Insecure Direct Object Reference (IDOR) - any authenticated user can delete env vars, labels, volumes, or ports from any app.
Location
HandleEnvVarDelete()ininternal/handlers/app.goHandleLabelDelete()ininternal/handlers/app.goHandleVolumeDelete()ininternal/handlers/app.goHandlePortDelete()ininternal/handlers/app.goFix
After finding the resource, verify
resource.AppID == appIDbefore deleting.Closing as duplicate of #19, which was fixed in PR #28 (merged).