BETA Shoulder is in beta — Findings may sometimes be wrong. Your feedback shapes what we fix next. Share feedback

Description

Detects horizontal privilege escalation where users can access or modify other users' resources.

What Shoulder detects

User can access other users' resources without authorization

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 .

Related rules