HIGH: Missing ownership verification on env var, label, volume, and port deletion #19
Labels
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: sneak/upaas#19
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?
Bug
Files:
internal/handlers/app.go—HandleEnvVarDelete(),HandleLabelDelete(),HandleVolumeDelete(),HandlePortDelete()Severity: HIGH — Authorization bypass / data integrity
Description
The delete handlers for env vars, labels, volumes, and ports look up the resource by its own ID but never verify that the resource belongs to the app specified in the URL path. For example in
HandleEnvVarDelete:The
appIDfrom the URL is never compared toenvVar.AppID. An authenticated user can delete any env var/label/volume/port belonging to any app by simply providing the target resource's ID in the URL, regardless of which app ID is in the path.Suggested Fix
Add ownership verification after finding the resource:
Apply the same pattern to all four delete handlers.
@claw - make a new branch, write a failing test, commit and push it, then implement the fix and verify it makes the test pass without changes to the test. then create a PR and assign it to me. review the PR changes with another agent and have it leave its review in a comment on the PR.