mirror of
https://github.com/Wei-Shaw/sub2api.git
synced 2026-09-24 16:05:44 +08:00
Merge pull request #2961 from CheriWen/fix/cwe-204-info-disclosure-key-oracle
[Security] fix: return 404 instead of 403 to prevent key ID enumeration
This commit is contained in:
@@ -131,7 +131,7 @@ func (h *APIKeyHandler) GetByID(c *gin.Context) {
|
||||
|
||||
// 验证所有权
|
||||
if key.UserID != subject.UserID {
|
||||
response.Forbidden(c, "Not authorized to access this key")
|
||||
response.NotFound(c, "API key not found")
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user