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.
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.
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:
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.
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:
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.
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:
- The Production Database:
PG_DATABASE_URLconnected directly to PostgreSQL 15.6 at5.161.100[.]52:5435. The role waspostgres— running withrolcreateroleandrolcreatedbprivileges 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. - Amazon S3 & Cloud Storage: The leaked AWS IAM keys for
scrapbook-prod(AKIA4OCVI72O...) permitteds3: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 inscrapbook-into-the-redwoods. - 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. Twoxoxpuser tokens impersonating real staff members carriedusers.profile:writeandgroups:history, giving complete ability to read private channels, post as trusted personnel, and alter member profiles. - Verified Domain Phishing: A live SendGrid API key authorized
mail.sendfromteam@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. - SSO Identity Provider: The client secret for
auth.hackclub[.]comauthenticated 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:
secret: process.env.BETTER_AUTH_SECRET || process.env.TOKEN_SECRETBecause 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$$
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:
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:
- Immediate Containment: The
/api/cssendpoint was disabled, eliminating the unauthenticated file-read primitive. - 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.
- 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.