Title: cold-store-reaper: live Google access token is cached in state.json, which the README calls '(no secrets)' and which is written without 0600 permissions · Issue #940 · developing-today/code · GitHub
Open Graph Title: cold-store-reaper: live Google access token is cached in state.json, which the README calls '(no secrets)' and which is written without 0600 permissions · Issue #940 · developing-today/code
X Title: cold-store-reaper: live Google access token is cached in state.json, which the README calls '(no secrets)' and which is written without 0600 permissions · Issue #940 · developing-today/code
Description: Finding cold-store-reaper caches a live Google OAuth access token in state.json, while the README describes state.json as "(no secrets)" and the file is written without the restrictive permissions the package applies to real credentials....
Open Graph Description: Finding cold-store-reaper caches a live Google OAuth access token in state.json, while the README describes state.json as "(no secrets)" and the file is written without the restrictive permissions ...
X Description: Finding cold-store-reaper caches a live Google OAuth access token in state.json, while the README describes state.json as "(no secrets)" and the file is written without the restrictive pe...
Opengraph URL: https://github.com/developing-today/code/issues/940
X: @github
Domain: github.com
IPv4 address: 140.82.114.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"cold-store-reaper: live Google access token is cached in state.json, which the README calls '(no secrets)' and which is written without 0600 permissions","articleBody":"## Finding\n\ncold-store-reaper caches a live Google OAuth **access token** in `state.json`, while the README describes `state.json` as \"(no secrets)\" and the file is written without the restrictive permissions the package applies to real credentials. Anyone or anything that can read `state.json` (backups, sync tools, another process in a less-protected home) holds a working Drive bearer token for its lifetime (~1h).\n\nFound by the pr-diff-review job reviewing PR #923 (cold-store-reaper v1), 2026-10-25; verified on current main (`92d0c6ee`).\n\n## Evidence\n\n- `pkgs/cold-store-reaper/README.md:52`: `state.json # folder IDs + cached access token (no secrets)` — the sentence contradicts itself: a cached access token is a credential.\n- `pkgs/cold-store-reaper/cold_store.py:332` (in `access_token()`): `state[\"access_token\"] = token`, persisted via `save_state()` (lines 228-229) → `_write_json()` (line 207), a plain `path.write_text(...)` with no mode restriction.\n- Contrast the package's own credential handling: `_write_private_json()` writes `credentials.json` (client secret + refresh token) with `os.open(..., 0o600)` and an explicit chmod. The access token gets neither treatment.\n- The only hardening is `init()` chmodding the home directory to `0o700` (line ~191 area) — that does not run on later invocations, and `$COLD_STORE_HOME` may point at a directory the tool did not create.\n- Note the v2 D1 code in the same file is careful to take `CLOUDFLARE_API_TOKEN` \"from the environment only; it is never stored\" — the Drive access token deserves the same rule.\n\n## Why it matters\n\nA short-lived token is still a live credential: with `drive.file` scope it can read/modify everything the cold-store app owns — which is the entire archive. The \"(no secrets)\" label invites copying `state.json` into places secrets must never go (a synced folder, a debug bundle, a repo).\n\n## Acceptance criteria\n\n- [ ] The access token is no longer persisted in `state.json` (keep it in memory only), OR `state.json` is written with `0o600` permissions via the existing private-write helper and the README stops claiming \"(no secrets)\".\n- [ ] README's file-layout table accurately describes what `state.json` contains.\n- [ ] Existing tests still pass; a test or check confirms no token value lands in `state.json` under the chosen design (if in-memory-only).\n\n— filed by the pr-diff-review job (PR #923); triage via the repo-health queue pilot.\n","author":{"url":"https://github.com/dezren39","@type":"Person","name":"dezren39"},"datePublished":"2026-10-26T01:58:52Z","url":"https://github.com/developing-today/code/issues/940"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:969740c4-707b-75a9-249b-529f3043f956 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C9DE:3BC3E6:92B478:BE01FE:6B063236 |
| html-safe-nonce | 726ca243b79fc453494ad70b45df48e63750956fe7aecb51f3911f939724818d |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDOURFOjNCQzNFNjo5MkI0Nzg6QkUwMUZFOjZCMDYzMjM2IiwidmlzaXRvcl9pZCI6IjcwMjY3Mzg3MjYyNDAxMzc3ODIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 7443bdc975d257e81478d73c09afa13377d42c3f418bcea276c00a5f8ecad6be |
| hovercard-subject-tag | issue:6031946217 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/developing-today/code/940/issue_layout |
| twitter:image | https://opengraph.githubassets.com/9cc2ba14f8bd734cdc19abdc3cfefb87282c4b6b7282b6dc086fd95f82718fab/developing-today/code/issues/940 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/9cc2ba14f8bd734cdc19abdc3cfefb87282c4b6b7282b6dc086fd95f82718fab/developing-today/code/issues/940 |
| og:image:alt | Finding cold-store-reaper caches a live Google OAuth access token in state.json, while the README describes state.json as "(no secrets)" and the file is written without the restrictive permissions ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | dezren39 |
| hostname | github.com |
| expected-hostname | github.com |
| None | c3584c853cd39700ecff6e2cf8364295ffdb5313e571046c41cd2479270f7df0 |
| turbo-cache-control | no-preview |
| go-import | github.com/developing-today/code git https://github.com/developing-today/code.git |
| octolytics-dimension-user_id | 26439447 |
| octolytics-dimension-user_login | developing-today |
| octolytics-dimension-repository_id | 627308783 |
| octolytics-dimension-repository_nwo | developing-today/code |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 627308783 |
| octolytics-dimension-repository_network_root_nwo | developing-today/code |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 9eb3bb1597d09170a5f282cd38ae376dee1a5ec1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width