Notes from a conversation: if I post a gist, what's the probability an adversary can find it? And how does this connect to object capabilities?
A user
-
Content
$C$ — files, text$T$ , possibly identifiers (emails, keys, function names) -
Visibility
$v \in {\textsf{public}, \textsf{secret}}$ — GitHub doesn't offer truly private gists outside Enterprise -
Identifier
$\mathrm{id}(G)$ — a 32-hex-char string ($\approx 2^{128}$ space) in the URLgist.github.com/{user}/{id}
An adversary
-
Prior knowledge
$K$ — e.g., they know$U$ 's handle, a keyword in$C$ , or possess a leaked URL -
Resources
$R$ — rate-limited API budget, compute, archive access, ability to subpoena, etc. -
Goal
$\Phi$ — targeted (find this gist) vs. content-class (find any gist matching predicate$\phi$ )
The quantity of interest:
A gist becomes reachable through a union of (roughly independent) channels
| Channel | Public |
Secret |
|---|---|---|
GET /users/{U}/gists listing |
enumerable | excluded |
/gists/public firehose (live + ~3000 backlog) |
~real-time | — |
GHArchive (every public GistEvent since 2011, in BigQuery) |
permanent | — |
gist.github.com keyword search |
indexed | — |
| Google / Bing / Kagi web index | if crawlable | only if URL leaked into a crawled page |
Brute-force id enumeration |
n/a |
|
| Referer leaks, screenshots, browser sync, paste history | possible | possible |
| Subpoena / GitHub insider | yes | yes |
Secret-gist privacy is essentially URL-capability security: knowledge of the URL ≡ access. There is no access control beyond unguessability.
Public listing (targeted,
Public firehose (untargeted scrape). Backlog cap means
GHArchive. Removes the streaming requirement: any public gist event is recoverable for arbitrary
Content search by predicate
Brute force on secret id.
URL leakage. The only meaningful attack on secret gists, and not a search problem — it's a side-channel. Probability depends on
-
Passive untargeted observer — wants any gist matching
$\phi$ .- Public:
$P_{\text{find}} \approx 1$ via GHArchive + fetch. This is how secret-scanning bots find leaked AWS keys within minutes. - Secret:
$P_{\text{find}} \approx 0$ .
- Public:
-
Targeted observer (knows
$U$ ) — wants$U$ 's gists.- Public:
$P = 1$ trivially. - Secret:
$P \approx 0$ from GitHub alone; reduces to URL-leak probability.
- Public:
-
Content-targeted adversary (knows distinguishing string
$s \in C$ ).- Public:
$P \to 1$ once GHArchive ingests$t_0$ (lag: minutes to an hour). - Secret:
$P \approx 0$ unless$s$ also appears in a crawled page that links to the gist.
- Public:
-
URL-capability adversary (has the secret link). Sources: scraped Slack/Discord exports, paste sites, browser history, stolen device.
$P = 1$ for both visibilities. This is the realistic threat model for secret gists. -
Legal/insider (subpoena, GitHub employee).
$P = 1$ regardless.
The interesting quantity is
Practical implication: "Secret" gists are confidentiality-by-capability, not by access control. If you treat the URL as a bearer token, they're as private as the weakest channel they pass through. If you need real access control, gists are the wrong primitive — use a private repo.
This is almost exactly the capability URL (a.k.a. "web-key" or "swiss-number URL") pattern. Canonical references:
-
Tyler Close, "Web-Key: Mashing with Permission" (W2SP / WWW 2008). The foundational paper: an unguessable URL fragment is a capability in the object-capability sense; possession ≡ authority, no ambient access control needed. The right citation for what gist secret-IDs actually are.
-
W3C TAG Finding, "Capability URLs" (Jeni Tennison, 2014). Less formal, more practitioner-facing. Enumerates the leak channels you'd want in
$P_{\text{leak}}$ : Referer headers, browser history sync, server logs, accidental sharing, search-engine indexing if linked. The empirical companion to Close. -
Mark Miller, "Robust Composition" (PhD thesis, 2006); Miller / Yee / Shapiro, "Capability Myths Demolished" (2003). The general object-capability theory. The bridge to URLs: an unguessable URL behaves as an unforgeable reference as long as the URL stays confidential.
- Meli, McNiece, Reaves, "How Bad Can It Git? Characterizing Secret Leakage in Public GitHub Repositories" (NDSS 2019). Quantifies the content-targeted adversary against the public firehose; shows it's devastating — keys get scraped within minutes. truffleHog, gitleaks, and GitHub's own secret-scanning are the operational instantiations.
The framing above — adversary-model-indexed probability of discovery as a function of channels and resources — is more implicit than explicit in the cap-URL literature, which tends to argue qualitatively ("URLs leak through these channels, design accordingly") rather than putting a
- OAuth bearer-token threat models (RFC 6819, "OAuth 2.0 Threat Model and Security Considerations") — same shape, more enumerated threat catalogue.
- Privacy literature on "practical obscurity" (Reidenberg and others, post-US DOJ v. Reporters Committee) — different vocabulary, but the underlying observation that "technically public but hard to find" collapses under modern indexing is the same phenomenon, on the public-gist side.
A secret gist URL is a bearer capability with no revocation primitive other than deleting the gist, no attenuation, and no audit trail of delegation. All the classic cap-URL critiques apply. The GHArchive-class adversary on the public side is the dual problem — no capability needed; the namespace itself is enumerable.