Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Slack Engineering 10 min read Case study mediumAdept

Catching Compromised Cookies

Slack detects stolen session cookies by spotting session forking: a last-access timestamp is stored in both the cookie and the database, and a mismatch on a later request means more than one copy of the cookie is in use. Early false positives from clients that never received refreshed cookies were cut by matching IP addresses and by a two-phase, idempotent "session candidate" cookie that is promoted only after the client proves it stored the new value. In-flight request races are handled by ignoring timestamps right after an update. Database reads are skipped while a cookie is freshly issued. High-risk detections, scored using device and network signals, go to the audit log for customers' SIEMs.

Assumes: HTTP cookies and sessionsSession hijacking basics

Related posts

  • Proactive Measures Against Password Breaches and Cookie Hijacking

    Slack Engineering easyNovice

    Slack automatically invalidates user credentials that show up in threat intelligence feeds from breaches, dark web forums, botnets and infostealer malware. Leaked passwords are matched against Slack's salted-hash store by salting and hashing each candidate in parallel batches on a job queue. On a match the password is reset and blocked from reuse, and the candidate data is then discarded. Hijacked session cookies are also invalidated, but timed to fall outside the user's local weekday working hours so no one is logged out mid-conversation, with email notification and Enterprise audit log events. This builds on Slack's regex-based scanning, in place since 2016, that revokes tokens and webhooks leaked in public code.

  • Slack Audit Logs and Anomalies

    Slack Engineering mediumAdept

    Slack Enterprise Grid audit logs record platform actions and include anomaly events that flag unusual behaviour such as new user agents, excessive downloads, unexpected scraping, IP address changes and session fingerprint mismatches. Anomalies are best treated as investigation leads rather than incidents: tune them by allowlisting trusted CIDR ranges and ASNs, correlate them (a user_agent plus excessive_downloads plus session_fingerprint pattern suggests a stolen cookie being used to scrape), and aggregate per-user counts against historical norms. Ingesting the full audit log stream, not just anomalies, supplies context such as which files were downloaded. A walkthrough of a departing employee scraping data shows the dashboard investigation flow and session termination, and recommends allowlisting expected user agents rather than blocklisting bad ones.

  • Testing cookie behavior across hundreds of web surfaces with our in-house auditor

    Dropbox Tech mediumAdept

    Dropbox built an automated cookie auditor that uses Playwright to visit its 200+ web surfaces as a fresh, privacy-conscious visitor, running separate US, EU and Global Privacy Control scenarios that record cookies before interaction, decline non-essential cookies via the underlying consent controls (across 22 languages), reload, and verify the preference persists. Approved cookies and exceptions live outside the code so the Privacy team can update them without releases, and a companion URL detector deduplicates billions of traffic records into unique paths, then groups pages by consent logic to pick representative URLs. The auditor produces a weekly report separating likely violations from known false positives, and the main lesson is that defining correct behavior, maintaining the page inventory and triaging noise take more work than the browser automation itself.

  • Incident Report: March 30th, 2026 — Authenticated user data cached

    Railway easyNovice

    A CDN configuration change meant to enable Surrogate Keys for per-domain caching accidentally turned on edge caching for about 0.05% of Railway domains that had CDN disabled. For 52 minutes on March 30, 2026, GET responses, including authenticated ones, could be served to other users. Origin Cache-Control headers were honored and Set-Cookie headers were not cached, but GET responses without explicit cache headers were cached by default. Railway reverted the change, purged caches globally, added tests for caching behavior and now shards CDN rollouts over hours instead of minutes.

  • When protections outlive their purpose: A lesson on managing defense systems at scale

    GitHub Engineering mediumAdept

    Emergency protection rules added during past GitHub abuse incidents were left in place and began rate-limiting legitimate logged-out users with "Too many requests" errors. The rules combined fingerprinting with business-logic signals. Only 0.5–0.9% of fingerprint matches were blocked, but false positives still reached about 3–4 per 100,000 requests. Finding the cause meant correlating logs across edge, application and service layers with different schemas. GitHub removed the stale rules and now treats incident mitigations as temporary by default, with expiration, post-incident review and cross-layer visibility into which layer blocked a request.

The quest for software engineering knowledge.

Look:
Layout: