GHSA-w8jj-cwmc-wgq2: Github.com/lin snow/ech0 Ech0's Missing Authorization On System Vulnerability

MODERATE
CVSS 4.3
CWE-862
Published
Advisory Summary

GHSA-w8jj-cwmc-wgq2 is a MODERATE (CVSS 4.3) ech0's missing authorization on system vulnerability (CWE-862: Missing Authorization) affecting Github.com/lin snow/ech0 libraries in the Go ecosystem. The issue involves ech0's missing authorization on system logs allows non-admin information disclosure. Remediation is available by upgrading affected packages to version 4.4.3.

GHSA-w8jj-cwmc-wgq2 at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-w8jj-cwmc-wgq2
Severity MODERATE
CVSS v3.1 Base Score 4.3
CWE Classification CWE-862: Missing Authorization
Affected Product Github.com/lin snow/ech0
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 4.3

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality Low (C:L)
Integrity None (I:N)
Availability None (A:N)

How to Fix GHSA-w8jj-cwmc-wgq2

To remediate this vulnerability, upgrade all affected Github.com/lin snow/ech0 dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

github.com/lin-snow/ech0 fixed: 4.4.3
Upgrade github.com/lin-snow/ech0 to 4.4.3
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for github.com/lin-snow/ech0

How to Check if You Are Affected

To determine whether your application is affected by GHSA-w8jj-cwmc-wgq2, inspect your project dependencies for Github.com/lin snow/ech0:

inspect dependencies for github.com/lin-snow/ech0

Analyze the terminal output to locate any version of Github.com/lin snow/ech0 in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 4.4.3), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-862: Missing Authorization, where the product does not perform an authorization check when an actor attempts to access a resource or perform an action. In Github.com/lin snow/ech0, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

## Summary The system log endpoints (`GET /api/system/logs`, `GET /api/system/logs/stream`, `WS /ws/system/logs`) lack authorization checks, allowing any authenticated non-admin user to read and stream all server logs. These logs contain error stack traces, internal file paths, module names, and arbitrary structured fields that facilitate reconnaissance for further attacks. ## Details The dashboard routes in `internal/router/dashboard.go:7-8` register log endpoints on the `AuthRouterGroup` without any `RequireScopes` middleware: ```go // internal/router/dashboard.go func setupDashboardRoutes(appRouterGroup *AppRouterGroup, h *handler.Bundle) { appRouterGroup.AuthRouterGroup.GET("/system/logs", h.DashboardHandler.GetSystemLogs()) appRouterGroup.AuthRouterGroup.GET("/system/logs/stream", h.DashboardHandler.SSESubscribeSystemLogs()) appRouterGroup.WSRouterGroup.GET("/system/logs", h.DashboardHandler.WSSubscribeSystemLogs()) } ``` Compare with other admin-only routes that properly use `RequireScopes`: ```go // internal/router/setting.go — every route has RequireScopes appRouterGroup.AuthRouterGroup.GET("/settings", middleware.RequireScopes(authModel.ScopeAdminSettings), h.SettingHandler.GetSiteSettings()) ``` The `AuthRouterGroup` only applies `JWTAuthMiddleware()` (router.go:36), which validates the JWT and sets the viewer context but does **not** check admin status. The `WSRouterGroup` (router.go:37) has no middleware at all — the WebSocket handler only calls `ParseToken` to verify the JWT signature (dashboard.go:74) without any role/scope validation. The handler (`internal/handler/dashboard/dashboard.go:29-62`) and service (`internal/service/dashboard/dashboard.go:21-27`) contain zero authorization checks. Other services in the codebase properly enforce admin access: - `internal/service/inbox/inbox.go:132` — `ensureAdmin()` - `internal/service/migrator/migrator.go:360` — `ensureAdmin()` - `internal/service/comment/comment.go:719` — `requireAdmin()` Non-admin users are created with `IsAdmin: false` and `IsOwner: false` (`internal/service/user/user.go:220-221`) via the public registration endpoint. The `LogEntry` struct (`internal/util/log/log.go:78-87`) exposes: ```go type LogEntry struct { Time string `json:"time"` Level string `json:"level"` Msg string `json:"msg"` Module string `json:"module,omitempty"` Caller string `json:"caller,omitempty"` // internal file paths Error string `json:"error,omitempty"` // error stack traces Fields map[string]any `json:"fields,omitempty"` // arbitrary structured data Raw string `json:"raw,omitempty"` // raw log lines } ``` ## PoC ```bash # 1. Register a non-admin user (system allows up to 5 users by default) curl -X POST http://localhost:8080/api/register \ -H 'Content-Type: application/json' \ -d '{"username":"attacker","password":"Password123"}' # 2. Login to get session token TOKEN=$(curl -s -X POST http://localhost:8080/api/login \ -H 'Content-Type: application/json' \ -d '{"username":"attacker","password":"Password123"}' | jq -r '.data.token') # 3. Read system logs — should require admin but doesn't curl http://localhost:8080/api/system/logs \ -H "Authorization: Bearer $TOKEN" # Returns: {"code":1,"data":[{"time":"...","level":"error","msg":"...","module":"...","caller":"internal/service/user/user.go:145","error":"...","fields":{...}},...]} # 4. Subscribe to real-time log stream via SSE curl -N "http://localhost:8080/api/system/logs/stream?token=$TOKEN" # 5. Subscribe via WebSocket (WSRouterGroup has NO middleware) # wscat -c "ws://localhost:8080/ws/system/logs?token=$TOKEN" ``` ## Impact Any registered non-admin user can: - **Read all historical system logs** including error traces that reveal internal code paths, database errors, and application state - **Stream real-time logs** via SSE or WebSocket to monitor all server activity as it happens - **Gather reconnaissance data** — caller fields expose internal file paths and line numbers, error fields expose stack traces and database query failures, module fields map the internal architecture - **Monitor other users' actions** — authentication failures, registration events, and admin operations appear in logs This information disclosure lowers the bar for chaining further attacks by revealing the application's internal structure, error handling patterns, and operational state. ## Recommended Fix Add `RequireScopes` middleware with an admin scope to the dashboard routes: ```go // internal/router/dashboard.go func setupDashboardRoutes(appRouterGroup *AppRouterGroup, h *handler.Bundle) { appRouterGroup.AuthRouterGroup.GET("/system/logs", middleware.RequireScopes(authModel.ScopeAdminSettings), h.DashboardHandler.GetSystemLogs()) appRouterGroup.AuthRouterGroup.GET("/system/logs/stream", middleware.RequireScopes(authModel.ScopeAdminSettings), h.DashboardHandler.SSESubscribeSystemLogs()) appRouterGroup.WSRouterGroup.GET("/system/logs", middleware.RequireScopes(authModel.ScopeAdminSettings), h.DashboardHandler.WSSubscribeSystemLogs()) } ``` Additionally, the WebSocket handler should validate admin scope after parsing the token, since the `WSRouterGroup` lacks middleware: ```go // internal/handler/dashboard/dashboard.go — WSSubscribeSystemLogs claims, err := jwtUtil.ParseToken(token) if err != nil { ctx.AbortWithStatusJSON(http.StatusUnauthorized, gin.H{"msg": "invalid token"}) return } // Add admin check for WebSocket endpoint if claims.TokenType == authModel.TokenTypeAccess && !containsScope(claims.Scopes, authModel.ScopeAdminSettings) { ctx.AbortWithStatusJSON(http.StatusForbidden, gin.H{"msg": "admin access required"}) return } ```

GHSA-w8jj-cwmc-wgq2 Affected Github.com/lin snow/ech0 Versions

1 component(s)
Fixed Versions:
4.4.3
Product / Package Ecosystem Affected Versions Fixed Version
github.com/lin-snow/ech0
Go
< 4.4.3
4.4.3

References

Frequently Asked Questions

What is GHSA-w8jj-cwmc-wgq2?
GHSA-w8jj-cwmc-wgq2 is a security vulnerability in Github.com/lin snow/ech0 involving Ech0's Missing Authorization on System Logs Allows Non-Admin Information Disclosure under CWE-862: Missing Authorization.
Which Github.com/lin snow/ech0 versions are affected?
Affected versions include releases prior to 4.4.3 across affected packages: github.com/lin-snow/ech0.
What version fixes GHSA-w8jj-cwmc-wgq2?
Upgrading to 4.4.3 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/lin-snow/ech0 affected?
Yes, github.com/lin-snow/ech0 is affected in releases prior to 4.4.3. Upgrade your dependency to 4.4.3 or later.
What is the CVSS score of GHSA-w8jj-cwmc-wgq2?
GHSA-w8jj-cwmc-wgq2 has a CVSS v3.1 base score of 4.3 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:N.
What CWE is associated with GHSA-w8jj-cwmc-wgq2?
GHSA-w8jj-cwmc-wgq2 is classified under CWE-862: Missing Authorization (The product does not perform an authorization check when an actor attempts to access a resource or perform an action.).
How can I check Go dependencies for GHSA-w8jj-cwmc-wgq2?
Run the dependency tree command: 'inspect dependencies for github.com/lin-snow/ech0'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-w8jj-cwmc-wgq2",
  "modified" : "2026-04-10T19:49:33Z",
  "published" : "2026-04-10T19:49:33Z",
  "aliases" : [ ],
  "summary" : "Ech0's Missing Authorization on System Logs Allows Non-Admin Information Disclosure",
  "details" : "## Summary\n\nThe system log endpoints (`GET /api/system/logs`, `GET /api/system/logs/stream`, `WS /ws/system/logs`) lack authorization checks, allowing any authenticated non-admin user to read and stream all server logs. These logs contain error stack traces, internal file paths, module names, and arbitrary structured fields that facilitate reconnaissance for further attacks.\n\n## Details\n\nThe dashboard routes in `internal/router/dashboard.go:7-8` register log endpoints on the `AuthRouterGroup` without any `RequireScopes` middleware:\n\n```go\n// internal/router/dashboard.go\nfunc setupDashboardRoutes(appRouterGroup *AppRouterGroup, h *handler.Bundle) {\n\tappRouterGroup.AuthRouterGroup.GET(\"/system/logs\", h.DashboardHandler.GetSystemLogs())\n\tappRouterGroup.AuthRouterGroup.GET(\"/system/logs/stream\", h.DashboardHandler.SSESubscribeSystemLogs())\n\tappRouterGroup.WSRouterGroup.GET(\"/system/logs\", h.DashboardHandler.WSSubscribeSystemLogs())\n}\n```\n\nCompare with other admin-only routes that properly use `RequireScopes`:\n\n```go\n// internal/router/setting.go — every route has RequireScopes\nappRouterGroup.AuthRouterGroup.GET(\"/settings\",\n    middleware.RequireScopes(authModel.ScopeAdminSettings),\n    h.SettingHandler.GetSiteSettings())\n```\n\nThe `AuthRouterGroup` only applies `JWTAuthMiddleware()` (router.go:36), which validates the JWT and sets the viewer context but does **not** check admin status. The `WSRouterGroup` (router.go:37) has no middleware at all — the WebSocket handler only calls `ParseToken` to verify the JWT signature (dashboard.go:74) without any role/scope validation.\n\nThe handler (`internal/handler/dashboard/dashboard.go:29-62`) and service (`internal/service/dashboard/dashboard.go:21-27`) contain zero authorization checks. Other services in the codebase properly enforce admin access:\n- `internal/service/inbox/inbox.go:132` — `ensureAdmin()`\n- `internal/service/migrator/migrator.go:360` — `ensureAdmin()`\n- `internal/service/comment/comment.go:719` — `requireAdmin()`\n\nNon-admin users are created with `IsAdmin: false` and `IsOwner: false` (`internal/service/user/user.go:220-221`) via the public registration endpoint.\n\nThe `LogEntry` struct (`internal/util/log/log.go:78-87`) exposes:\n```go\ntype LogEntry struct {\n    Time   string         `json:\"time\"`\n    Level  string         `json:\"level\"`\n    Msg    string         `json:\"msg\"`\n    Module string         `json:\"module,omitempty\"`\n    Caller string         `json:\"caller,omitempty\"`   // internal file paths\n    Error  string         `json:\"error,omitempty\"`     // error stack traces\n    Fields map[string]any `json:\"fields,omitempty\"`    // arbitrary structured data\n    Raw    string         `json:\"raw,omitempty\"`       // raw log lines\n}\n```\n\n## PoC\n\n```bash\n# 1. Register a non-admin user (system allows up to 5 users by default)\ncurl -X POST http://localhost:8080/api/register \\\n  -H 'Content-Type: application/json' \\\n  -d '{\"username\":\"attacker\",\"password\":\"Password123\"}'\n\n# 2. Login to get session token\nTOKEN=$(curl -s -X POST http://localhost:8080/api/login \\\n  -H 'Content-Type: application/json' \\\n  -d '{\"username\":\"attacker\",\"password\":\"Password123\"}' | jq -r '.data.token')\n\n# 3. Read system logs — should require admin but doesn't\ncurl http://localhost:8080/api/system/logs \\\n  -H \"Authorization: Bearer $TOKEN\"\n# Returns: {\"code\":1,\"data\":[{\"time\":\"...\",\"level\":\"error\",\"msg\":\"...\",\"module\":\"...\",\"caller\":\"internal/service/user/user.go:145\",\"error\":\"...\",\"fields\":{...}},...]}\n\n# 4. Subscribe to real-time log stream via SSE\ncurl -N \"http://localhost:8080/api/system/logs/stream?token=$TOKEN\"\n\n# 5. Subscribe via WebSocket (WSRouterGroup has NO middleware)\n# wscat -c \"ws://localhost:8080/ws/system/logs?token=$TOKEN\"\n```\n\n## Impact\n\nAny registered non-admin user can:\n- **Read all historical system logs** including error traces that reveal internal code paths, database errors, and application state\n- **Stream real-time logs** via SSE or WebSocket to monitor all server activity as it happens\n- **Gather reconnaissance data** — caller fields expose internal file paths and line numbers, error fields expose stack traces and database query failures, module fields map the internal architecture\n- **Monitor other users' actions** — authentication failures, registration events, and admin operations appear in logs\n\nThis information disclosure lowers the bar for chaining further attacks by revealing the application's internal structure, error handling patterns, and operational state.\n\n## Recommended Fix\n\nAdd `RequireScopes` middleware with an admin scope to the dashboard routes:\n\n```go\n// internal/router/dashboard.go\nfunc setupDashboardRoutes(appRouterGroup *AppRouterGroup, h *handler.Bundle) {\n\tappRouterGroup.AuthRouterGroup.GET(\"/system/logs\",\n\t\tmiddleware.RequireScopes(authModel.ScopeAdminSettings),\n\t\th.DashboardHandler.GetSystemLogs())\n\tappRouterGroup.AuthRouterGroup.GET(\"/system/logs/stream\",\n\t\tmiddleware.RequireScopes(authModel.ScopeAdminSettings),\n\t\th.DashboardHandler.SSESubscribeSystemLogs())\n\tappRouterGroup.WSRouterGroup.GET(\"/system/logs\",\n\t\tmiddleware.RequireScopes(authModel.ScopeAdminSettings),\n\t\th.DashboardHandler.WSSubscribeSystemLogs())\n}\n```\n\nAdditionally, the WebSocket handler should validate admin scope after parsing the token, since the `WSRouterGroup` lacks middleware:\n\n```go\n// internal/handler/dashboard/dashboard.go — WSSubscribeSystemLogs\nclaims, err := jwtUtil.ParseToken(token)\nif err != nil {\n    ctx.AbortWithStatusJSON(http.StatusUnauthorized, gin.H{\"msg\": \"invalid token\"})\n    return\n}\n// Add admin check for WebSocket endpoint\nif claims.TokenType == authModel.TokenTypeAccess && !containsScope(claims.Scopes, authModel.ScopeAdminSettings) {\n    ctx.AbortWithStatusJSON(http.StatusForbidden, gin.H{\"msg\": \"admin access required\"})\n    return\n}\n```",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/lin-snow/ech0"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "4.4.3"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/lin-snow/Ech0/security/advisories/GHSA-w8jj-cwmc-wgq2"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/lin-snow/Ech0"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/lin-snow/Ech0/releases/tag/v4.4.3"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-862" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-04-10T19:49:33Z",
    "nvd_published_at" : null
  }
}