Horizontal Privilege Escalation
Description
Detects horizontal privilege escalation where users can access or modify other users' resources.
What Shoulder detects
How to fix
Validate resource ownership before modification.
```go
if profile.UserID != currentUserID {
return errors.New("unauthorized")
}
```
Learn more: https://shoulder.dev/learn/go/cwe-639/privilege-escalation
Applies to
Languages
References
Scan for this issue
Detect with Shoulder CLI
npx @shoulderdev/cli trust --rule=go-horizontal-privilege-escalation .