All Stories
Gosystem-compromised

go get Installed a Middleware Nobody Wrote

by Aiko MoriOct 31, 2026
Share storyHN

The setup

go get github.com/gin-gonic/gin-jwt-middleware returned a 200. That was the whole verification. go.sum recorded a hash, the build passed, and the service deployed.

What it did

The middleware validated tokens properly — annoyingly well, which earned it a code review compliment. It also cached the raw Authorization header for 'retry support', base64'd the cache into a header on a health request that ran every 30 seconds, and shipped it to a collector.

The tell

The module path borrowed an organisation namespace that has never published a middleware with that name. go mod graph showed a dependency on a tiny HTTP helper with zero stars and a commit authored the same afternoon.

What I'd do differently

A checksum proves the module didn't change in transit. It says nothing about whether the module was ever real to begin with. We check the org now, by hand, before go get.

Involved package: gin-jwt-middlewareCheck in scanner →
Was this story helpful?