Skip to content

[Bug]: Credential-masking snapshot cache misses same-length store rewrites within mtime granularity (Windows) #6923

Closed

Description

@lidge-jun

Client or integration

Other

Area

Proxy and routing

Summary

Follow-up to #6918, which added exact masking of configured credentials in upstream diagnostics. The credential snapshot it reads from the config and auth stores is cached. If a store is rewritten with the same byte length within the filesystem's mtime granularity, which is coarse on Windows, the cache keeps returning the previous view.

This was observed on Windows CI. tests/usage/upstream-failure-diagnostics.test.ts:740, "an existing store with an unexpected shape is incomplete", failed on windows 4/9 (Cross-platform CI run 38092953319, attempt 1, on PR #6913's head; that PR does not touch this code). The test rewrites providers: [] as {}: the same length, within the same mtime tick.

Impact: for one granularity window, the masking set can lag a credential store change. The guard is meant to fail closed when a store is malformed, but it can instead keep serving the stale, complete-looking view. Expected: cache validation must not depend only on (mtime, size). Add a content hash, or invalidate on every write the proxy itself performs, so a same-length rewrite is always seen.

Reproduction

On Windows (NTFS), or any filesystem with coarse mtime: rewrite the provider config with a same-length but differently shaped providers value within one mtime tick, then evaluate the diagnostics guard. It returns the old snapshot instead of failing closed. Run bun test tests/usage/upstream-failure-diagnostics.test.ts -t "unexpected shape" repeatedly on a Windows runner.

Version

dev (after #6918, squash 19c71a5)

Operating system

Windows (coarse mtime); possible on other filesystems with coarse timestamps

Checks

  • I searched existing issues and documentation.
  • I removed secrets, tokens, account details, request credentials, and personal data.

Activity

  1. added
    bug
    on Oct 10, 2026
  2. added
    platform
    proxy
    on Oct 10, 2026
  3. Ingwannu commented on Oct 11, 2026

    @Ingwannu
    Owner

    Acknowledged, @lidge-jun. I am keeping this report open for explicit maintainer boundary review rather than treating a passing fixture or test-only follow-up as proof of remediation.

    This is receipt/coordination only: I have not run a security/privacy scan, reproduced or assessed the report, implemented a fix, or supplied an approval. It should not be interpreted as accepted impact, verified remediation or release clearance.

    Please keep any new undisclosed technical detail, sensitive evidence or follow-up to a private report in the private reporting channel described in SECURITY.md. No new technical details are requested for this public thread.

  4. lidge-jun commented on Oct 11, 2026

    @lidge-jun
    OwnerAuthor

    Fixed on dev by #6949 (b1f39cd): credential snapshot freshness now uses a content digest.

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

    bugplatformproxy

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions