fix: redact attachment upload path logs#2127
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe PR adds lightweight summarization helper functions for upload metadata and file path shapes, then updates all ChangesLogging Shape Summarization for File Handlers
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Merging this PR will not alter performance
Comparing Footnotes
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@supabase/functions/_backend/files/files.ts`:
- Around line 40-47: The function summarizeUploadMetadata currently exposes raw
key names and lengths; change it to emit only shape-only info: replace keys:
Object.keys(metadata) with keysCount: Object.keys(metadata).length and remove
any properties that reveal string lengths (filenameLength, filetypeLength); keep
only booleans like hasFilename and hasFiletype (based on metadata.filename !=
null and metadata.filetype != null) so no user-supplied names or lengths are
logged. Update the summarizeUploadMetadata signature/return shape accordingly
wherever it's consumed.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 2d911953-bd76-47bd-9c13-63765a414e0d
📒 Files selected for processing (1)
supabase/functions/_backend/files/files.ts
This comment was marked as abuse.
This comment was marked as abuse.
Keep TUS upload routing behavior unchanged while replacing raw metadata, URL, decoded upload IDs, and extracted file paths in cloudlog calls with shape-only summaries. This preserves operational breadcrumbs without storing organization/app/file path values in routine worker logs. Constraint: public security bounty thread favors scoped hardening PRs with safe public details Rejected: remove upload logs entirely | would reduce debug signal for TUS forwarding and path normalization Confidence: high Scope-risk: narrow Directive: do not reintroduce raw Upload-Metadata, request URL, decoded TUS IDs, or attachment file paths into routine logs Tested: bunx eslint supabase/functions/_backend/files/files.ts; git diff --check Not-tested: full TUS integration suite not run; change is log-shape only
This comment was marked as abuse.
This comment was marked as abuse.
|
|
Closing as AI-generated spam. Part of a 50+ PR wave of duplicate |



Summary
Motivation
The attachment upload path currently logs raw
Upload-Metadata, decoded TUS IDs, extracted file paths, and full request URLs while normalizing resumable uploads. Those values can include organization/app/file path details and upload identifiers. This keeps the useful operational signal without retaining those raw values in routine worker logs.Business impact
Reduces accidental sensitive metadata exposure in upload worker logs without changing upload behavior.
Test plan
bunx eslint supabase/functions/_backend/files/files.tsgit diff --checkChecklist
Summary by CodeRabbit