Skip to content

Shared graph cache: a too-short DIFFCI_GRAPH_CACHE_SECRET falls back to plaintext uploads #263

Closed

Description

@FredApps

What went wrong?

When DIFFCI_GRAPH_CACHE_SECRET is set but shorter than 16 characters, the shared graph cache ignores the secret and still enables the remote tier, so dependency graphs (which carry repository file paths) are uploaded as plaintext JSON under unhashed keys.

In configureGraphCache (packages/diffci-cli/src/client/shared-graph-cache.ts, lines 356–362), a short secret becomes undefined with the note DIFFCI_GRAPH_CACHE_SECRET ignored: it must be at least 16 characters, and RemoteGraphCache is then created with secret: undefined unless --redact-paths is also set. encodeEnvelope then writes encoding: "json" with the plain payload, and remoteCacheKey returns the local key unchanged.

A user who sets the secret is asking for client-side encryption. A typo or a short value silently turns that into plaintext uploads, and the note is easy to miss in CI logs.

DiffCI version

main at 40aa308

Command you ran

configureGraphCache({
  repoPath, version: "1", defaultLocalRoot: tmpdir(), isInsideRepository,
  shared: true,
  apiUrl: "https://api.diffci.com/v1/ingest/observations",
  token: "dci_x",
  secret: "short",
});

This corresponds to DIFFCI_GRAPH_CACHE_SECRET=short diffci observe --shared-graph-cache with an https api-url and an api-token.

Environment

Linux, Node 24.

Output

The returned cache has a remote tier with no secret, and its uploads use encoding: "json".

What you expected

A secret that is set but too short should turn the shared tier off (with a note), the same way --redact-paths without a secret does, rather than fall back to plaintext uploads. The local tier can stay on.

Activity

  1. added a commit that references this issue on Nov 18, 2026
    b75d36a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions