Bug: EnvVar/Label/Volume/Port deletion does not verify resource belongs to the app in URL (IDOR) #3

Closed
opened 2026-02-08 21:01:05 +01:00 by clawbot · 1 comment
Collaborator

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's AppID matches 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() in internal/handlers/app.go
  • HandleLabelDelete() in internal/handlers/app.go
  • HandleVolumeDelete() in internal/handlers/app.go
  • HandlePortDelete() in internal/handlers/app.go

Fix

After finding the resource, verify resource.AppID == appID before deleting.

## 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's `AppID` matches 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()` in `internal/handlers/app.go` - `HandleLabelDelete()` in `internal/handlers/app.go` - `HandleVolumeDelete()` in `internal/handlers/app.go` - `HandlePortDelete()` in `internal/handlers/app.go` ## Fix After finding the resource, verify `resource.AppID == appID` before deleting.
Author
Collaborator

Closing as duplicate of #19, which was fixed in PR #28 (merged).

Closing as duplicate of #19, which was fixed in PR #28 (merged).
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: sneak/upaas#3
No description provided.