Skip to content

fix: filter prototype keys in Claude Code transcript and federated peer usage maps (#14658) - #14662

Merged
atomantic merged 1 commit into
mainfrom
claim/issue-14658
Nov 2, 2026
Merged

atomantic merged 1 commit into
mainfrom
claim/issue-14658

Conversation

@atomantic

Copy link
Copy Markdown
Owner

Summary

Filters prototype-polluting keys (__proto__, constructor, prototype) and guards against inherited properties in Claude Code transcript scanning, sanitization, and merge, as well as in federated peer usage ingestion.

  • Claude Code Transcript Scanning (server/services/claudeCodeTranscriptUsage.js):
    • Uses POLLUTING_KEYS and bucketFor from ../lib/objects.js to avoid creating or mutating prototype properties during collectFile() and scanTranscriptDays().
    • In sanitizeTranscriptDays(), skips POLLUTING_KEYS in day and model keys.
    • In mergeDays(), ensures target[model] only checks own properties with Object.hasOwn(target, model) and skips POLLUTING_KEYS.
  • Peer Usage Ingestion (server/services/peerUsage.js):
    • In sanitizeProviderBucket() and sanitizeActivityBucket(), skips keys matching POLLUTING_KEYS.
    • In sanitizeActivityMap() and addInto(), guards against POLLUTING_KEYS and inherited properties.
  • Regression Tests:
    • Added test cases in server/services/claudeCodeTranscriptUsage.test.js and server/services/peerUsage.test.js verifying that hostile payloads with __proto__, constructor, and prototype are safely discarded and Object.prototype remains unpolluted.

Closes #14658

Reviews

  • provider:selection-a6718554da55db6d33801df2 (codex[gpt-6.1-terra]): 1 round, clean at 4c0cbd6.

@atomantic atomantic added implementer:gemini-3-8-flash-medium PR opened by the gemini-3-8-flash-medium model reviewer:gpt-6-1-terra Locally reviewed by the gpt-6-1-terra model labels Nov 2, 2026
@atomantic
atomantic merged commit 5acf39d into main Nov 2, 2026
16 checks passed
@atomantic
atomantic deleted the claim/issue-14658 branch November 2, 2026 05:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

implementer:gemini-3-8-flash-medium PR opened by the gemini-3-8-flash-medium model reviewer:gpt-6-1-terra Locally reviewed by the gpt-6-1-terra model

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Filter prototype keys in Claude Code transcript and federated peer usage maps

1 participant