You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CONVENTIONS.md
+33Lines changed: 33 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -783,6 +783,39 @@ try {
783
783
}
784
784
```
785
785
786
+
### Security: Masking 401/403 with 404
787
+
788
+
**Security Best Practice:** To prevent information disclosure, the backend typically returns `404 Not Found` instead of `401 Unauthorized` or `403 Forbidden` when a user lacks access to a resource.
789
+
790
+
**Why?**
791
+
-`401`/`403` reveals that the resource exists but you can't access it
792
+
- Attackers can enumerate which resources exist by observing status codes
793
+
-`404` is ambiguous - resource may not exist OR you lack permission
0 commit comments