Repository navigation
🛡️ Sentinel: [CRITICAL] Fix arbitrary sensitive file upload bypass - #629
madara88645 wants to merge 1 commit into
Conversation
🚨 Severity: CRITICAL 💡 Vulnerability: The `normalize_uploaded_filename` utility checked for sensitive names (e.g. `.env`, `.git`) but was missing checks for some keys (e.g., `id_rsa`, `.pem`) that were present in the centralized `_contains_sensitive_segment`. This allowed these files to be uploaded. 🎯 Impact: Attackers could upload arbitrary sensitive files such as SSH keys or PEM certificates that bypass basic checks but might be exploited elsewhere. 🔧 Fix: Replaced inline subset checks with a call to the robust `_contains_sensitive_segment` utility. ✅ Verification: Ran unit tests and ensured that `id_rsa` and `test.pem` are blocked correctly.
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Automation risk assessment
Risk level: Low
Evidence (diff-only)
| Area | Change |
|---|---|
app/utils/security.py |
normalize_uploaded_filename drops a partial inline blocklist and delegates to existing _contains_sensitive_segment, matching logic already used in is_safe_path. |
tests/test_security.py |
Adds coverage for id_rsa and test.pem upload names. |
.jules/sentinel.md |
Learning-journal note only (no runtime impact). |
Blast radius: Single upload-validation helper; behavior change is stricter (blocks additional sensitive path segments), not a new auth model or broad refactor.
Complexity: Low — reuses in-file utility; net −2 lines in production code.
Verification: CI green (ruff, bandit, mypy, backend tests, frontend build). Local pytest tests/test_security.py -k normalize_uploaded_filename: 7 passed.
Decision
- Reviewers: Not required (Low risk).
- Approval: Approved — no prior reviews on this PR; correctness and scope are clear from the diff.
Slack summary (for channel mirror)
PR #629 — unify upload filename sensitivity checks via _contains_sensitive_segment. Risk: Low. Approved. No extra reviewers assigned. CI passing.
Sent by Cursor Automation: Assign PR reviewers
|
Closing: #629 and #635 make the same change and the risk is overstated. Uploads land in the uploader's own 0700 temp dir, only supported source extensions are analysed, and snippet reads already go through |
Understood. Acknowledging that this work is now obsolete and stopping work on this task. |


🚨 Severity: CRITICAL
💡 Vulnerability: The
normalize_uploaded_filenameutility checked for sensitive names (e.g..env,.git) but was missing checks for some keys (e.g.,id_rsa,.pem) that were present in the centralized_contains_sensitive_segment. This allowed these files to be uploaded.🎯 Impact: Attackers could upload arbitrary sensitive files such as SSH keys or PEM certificates that bypass basic checks but might be exploited elsewhere.
🔧 Fix: Replaced inline subset checks with a call to the robust
_contains_sensitive_segmentutility.✅ Verification: Ran unit tests and ensured that
id_rsaandtest.pemare blocked correctly.PR created automatically by Jules for task 12319426089919742725 started by @madara88645