GHSA-fwg7-53p4-g33c
## Summary All 9 comment panel admin endpoints (`/api/panel/comments/*`) are missing `RequireScopes()` middleware, while every other admin endpoint in the application enforces scope-based authorization on access tokens. An admin-issued access token scoped to minimal permissions (e.g., `echo:read` only) can perform full comment moderation operations including listing, approving, rejecting, deleting comments, and modifying comment system settings. ## Details The access token scope enforcement system works as follows: `JWTAuthMiddleware` (`internal/middleware/auth.go`) parses any valid JWT and injects a viewer into the request context. The `RequireScopes()` middleware (`internal/middleware/scope.go:14`) then checks whether the token is an access token and, if so, validates that it carries the required scopes. Session tokens are passed through without scope checks (by design — sessions represent full user authority). Every admin route group applies `RequireScopes()` per-handler: - `internal/router/echo.go` — uses `RequireScopes(ScopeEchoWrite)` / `RequireScopes(ScopeEchoRead)` - `internal/router/file.go` — uses `RequireScopes(ScopeFileRead)` / `RequireScopes(ScopeFileWrite)` - `internal/router/user.go` — uses `RequireScopes(ScopeAdminUser)` / `RequireScopes(ScopeProfileRead)` - `internal/router/setting.go` — uses `RequireScopes(ScopeAdminSettings)` / `RequireScopes(ScopeAdminToken)` However, `internal/router/comment.go:28-36` registers all 9 panel endpoints directly on `AuthRouterGroup` without any `RequireScopes()` call: ```go // internal/router/comment.go:28-36 appRouterGroup.AuthRouterGroup.GET("/panel/comments", h.CommentHandler.ListPanelComments()) appRouterGroup.AuthRouterGroup.GET("/panel/comments/:id", h.CommentHandler.GetCommentByID()) appRouterGroup.AuthRouterGroup.PATCH("/panel/comments/:id/status", h.CommentHandler.UpdateCommentStatus()) appRouterGroup.AuthRouterGroup.PATCH("/panel/comments/:id/hot", h.CommentHandler.UpdateCommentHot()) appRouterGroup
Properties
- ghsa_id
- GHSA-fwg7-53p4-g33c
- severity
- medium
- summary
- Ech0 Comment Panel Endpoints Missing RequireScopes Middleware — Scoped Access Token Bypass
- cvss_score
- 5.5
- cve_id
- GHSA-fwg7-53p4-g33c
- cvss_vector
- CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:L/I:H/A:N
- is_ghsa_only
- true
- ghsa_published
- 2026-04-10T19:49:20Z
- source_url
- https://github.com/advisories/GHSA-fwg7-53p4-g33c
- ghsa_updated
- 2026-04-10T19:49:21Z
Related Entities (4)
VULNERABLE_TO (1)
AFFECTS (1)
HAS_WEAKNESS (1)
REPORTED_BY (1)
Explore deeper with Ninja Signal's threat intelligence graph