Skip to content

🛡️ Sentinel: [CRITICAL] Fix arbitrary sensitive file upload bypass - #629

Closed
madara88645 wants to merge 1 commit into
mainfrom
sentinel/fix-normalize-uploaded-filename-vulnerability-12319426089919742725
Closed

madara88645 wants to merge 1 commit into
mainfrom
sentinel/fix-normalize-uploaded-filename-vulnerability-12319426089919742725

Conversation

@madara88645

Copy link
Copy Markdown
Owner

🚨 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.


PR created automatically by Jules for task 12319426089919742725 started by @madara88645

🚨 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.
@google-labs-jules

Copy link
Copy Markdown

👋 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 @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@vercel

vercel Bot commented Sep 13, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
vibegraph Ready Ready Preview Sep 13, 2026 10:56pm UTC

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Open in Web View Automation 

Sent by Cursor Automation: Assign PR reviewers

@madara88645

Copy link
Copy Markdown
Owner Author

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 is_safe_path, which blocks id_rsa / .pem / .key. Routing normalize_uploaded_filename through _contains_sensitive_segment would also reject any path segment named identity (a common folder name in auth code) and fail the whole upload. #644 keeps private-key files from being uploaded at all, client-side. Thanks!

@google-labs-jules

Copy link
Copy Markdown

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 is_safe_path, which blocks id_rsa / .pem / .key. Routing normalize_uploaded_filename through _contains_sensitive_segment would also reject any path segment named identity (a common folder name in auth code) and fail the whole upload. #644 keeps private-key files from being uploaded at all, client-side. Thanks!

Understood. Acknowledging that this work is now obsolete and stopping work on this task.

This branch was successfully deployed

1 active deployment
Preview — 9295dc88 Deployed Sep 13, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant