Menu

I accidentally published my own analytics — and a stream key
📰

I accidentally published my own analytics — and a stream key

DEV Community: infosec·Cao Wen·14 days ago
#EdmlSHKe
#devtoinfosec#devto#dev#query#html
Reading 0:00
15s threshold

I added a nightly GoAccess report to my site for convenience. It wrote index.html and a dated snapshot into /static, fire-and-forget.

It worked. It also published every request URL, including query strings.

One of those URLs was:

/api/stream/token?key=

Two shop keys were sitting in a public HTML file for nine days. No admin path, no internal token, no customer emails — but a stream key is a credential. Anyone who found the URL could publish to that room.

What I did:

Moved the report output out of the web root (it now lives in a private directory).

Added --no-query-string to GoAccess so URLs are logged without query strings.

Kept --anonymize-ip and --ignore-crawlers.

Checked access logs: 35 requests over nine days, six IPs, almost all my own. No sign of scraping. Lucky, not safe.

Rotated the exposed keys.

What I should have known:

robots.txt is not access control. It keeps crawlers out, not people.

A static directory is public by definition.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.