Insecure Direct Object Reference (IDOR)
Description
Detects IDOR vulnerabilities where user-supplied IDs access resources without authorization checks.
What Shoulder detects
How to fix
Validate ownership before accessing resources.
```go
if requestedID != currentUserID && !isAdmin(currentUserID) {
return errors.New("unauthorized")
}
```
Learn more: https://shoulder.dev/learn/go/cwe-639/idor
Applies to
Languages
References
Scan for this issue
Detect with Shoulder CLI
npx @shoulderdev/cli trust --rule=go-idor .