Skip to content

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

Slack Engineering 6 min read Case study easyNovice

Proactive Measures Against Password Breaches and Cookie Hijacking

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.

Assumes: password hashing and saltingsession cookies

Related posts

  • Catching Compromised Cookies

    Slack Engineering mediumAdept

    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.

  • 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.

  • Protecting user data through source code analysis at scale

    Meta Engineering mediumAdept

    Meta's Anti-Scraping team encodes known scraping attack vectors as taint-analysis rules in its in-house static analyzers, Zoncolan for Hack and Pysa for Python, so potential vectors are flagged before code ships. Rules define sources (user-controlled parameters such as a result count or target ID) and sinks (data returned to the user), and a possible flow between them is raised as an issue for triage. In a mock followers endpoint, an uncapped count lets scrapers pull entire follower lists in one request and slip past rate limiting. The fix clamps count to a maximum, forcing scrapers into many more requests that rate limits then catch. Static analysis cannot catch scrapers that mimic legitimate usage, so it is one part of a broader defense.

  • How Meta is improving password security and preserving privacy

    Meta Engineering mediumAdept

    Meta's Private Data Lookup (PDL) checks new passwords against breached-password datasets using Private Set Intersection, so the server learns neither the attempted password nor whether it matched. The client sends a per-request blinded hash H(p)^a, the server double-blinds it with a long-term key b and returns blinded hashes of leaked passwords, and the client unblinds and matches locally. To make this practical, leaked passwords are pre-blinded offline, the dataset is sharded by a short hash-prefix index, and returned values are truncated to cut bandwidth. The check flags a password appearing anywhere in a breach, not just a matching username/password pair, and is deployed in Enterprise Center's account creation and reset flows.

  • Finding leaked passwords with AI: How we built Copilot secret scanning

    GitHub Engineering mediumAdept

    GitHub replaced regex-based detection of generic passwords with an LLM prompt that judges candidate secrets from their file context. The first GPT-3.5-Turbo few-shot prompt broke on unusual file types in customer repos. GitHub responded by expanding offline evals with customer reports and GPT-4-generated cases, adding GPT-4 as a confirming scanner, and adopting Microsoft's MetaReflection hybrid chain-of-thought/few-shot prompt. To scale full-history scans, they excluded low-value files and built a workload-aware rate limiter in which workloads borrow unused LLM capacity from each other. Mirror testing on preview repos showed up to a 94% drop in false positives with little recall loss.

The quest for software engineering knowledge.

Look:
Layout: