Skip to content

🛡️ Sentinel: [MEDIUM] Fix UI credential exposure#84

Open
bobdivx wants to merge 1 commit into
devfrom
sentinel-secure-credentials-16817019003414971376
Open

🛡️ Sentinel: [MEDIUM] Fix UI credential exposure#84
bobdivx wants to merge 1 commit into
devfrom
sentinel-secure-credentials-16817019003414971376

Conversation

@bobdivx
Copy link
Copy Markdown
Owner

@bobdivx bobdivx commented May 22, 2026

🚨 Severity: MEDIUM
💡 Vulnerability: Several configuration inputs handling sensitive secrets (C411 API Key, C411 Passkey, and TMDB API Key) were using standard type="text" fields.
🎯 Impact: This exposed the raw secrets on the user's screen (shoulder-surfing risk) and allowed the browser to store and auto-suggest the values in the future via built-in autofill mechanisms, creating a client-side leakage risk.
🔧 Fix: Modified the affected inputs across UploadTrackersManagerPanel.tsx, UploadTrackerPanel.tsx, and TmdbConfig.tsx to use type="password" and added autoComplete="off".
Verification: Verified the codebase still builds and tests pass. Visually, the inputs will now correctly mask the characters.


PR created automatically by Jules for task 16817019003414971376 started by @bobdivx

Replaced `type="text"` with `type="password"` and added `autoComplete="off"` to inputs handling sensitive credentials (C411 API Key, C411 Passkey, and TMDB API Key) across `UploadTrackersManagerPanel.tsx`, `UploadTrackerPanel.tsx`, and `TmdbConfig.tsx`. This prevents shoulder-surfing and stops browsers from auto-saving or leaking these secrets via autofill.

Co-authored-by: bobdivx <6737167+bobdivx@users.noreply.github.com>
@google-labs-jules
Copy link
Copy Markdown
Contributor

👋 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
Copy link
Copy Markdown

vercel Bot commented May 22, 2026

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

Project Deployment Actions Updated (UTC)
popcorn-client Ready Ready Preview, Comment May 22, 2026 6:39am

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request enhances security by converting sensitive credential inputs (API keys and passkeys) to password fields and adding autocomplete prevention across several settings components. It also updates the security log to document these changes. Review feedback identifies a bug in a focus handler where the incorrect state variable was being reset and recommends using autoComplete="new-password" instead of "off" for better browser compatibility. Additionally, a suggestion was made to maintain reverse-chronological order in the security log file.

<input
type="text"
type="password"
autoComplete="off"
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

high

In addition to using new-password, please note that there is a bug in the onFocus handler for this specific input at line 292 (just outside this diff hunk). It incorrectly calls setApiKey('') instead of setPasskey(''), which will clear the wrong state when the passkey field is focused.

Suggested change
autoComplete="off"
autoComplete="new-password"

Comment thread .jules/sentinel.md
**Vulnerability:** Weak PRNG `Math.random()` was used for generating IDs and UUIDs across multiple files (`src/lib/client/server-api/indexers.ts`, `src/api-routes-backup/v1/setup/indexers.ts`, `src/lib/utils/device-id.ts`, `src/components/torrents/MediaDetailPage/hooks/useNotifications.ts`).
**Learning:** `Math.random()` is not cryptographically secure and shouldn't be used for IDs, especially not for indexer setups and device IDs. Moreover, calling `globalThis.crypto.randomUUID()` directly fails on HTTP non-localhost sites since it requires a Secure Context.
**Prevention:** Always use the Web Crypto API (`crypto.getRandomValues()` or `crypto.randomUUID()`) through a centralized utility like `src/lib/utils/uuid.ts` that provides safe fallbacks for unsupported environments and non-secure contexts.
## 2024-05-24 - Secure Credential Inputs in Settings Panels
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The log entries in this file appear to follow a reverse-chronological order (newest at the top). The new entry for 2024-05-24 should be placed before the 2024-05-18 entry to maintain consistency.

Comment thread .jules/sentinel.md
## 2024-05-24 - Secure Credential Inputs in Settings Panels
**Vulnerability:** Several inputs handling sensitive credentials (C411 API Key, C411 Passkey, and TMDB API Key) were using standard `type="text"` input fields across multiple React components (`UploadTrackersManagerPanel.tsx`, `UploadTrackerPanel.tsx`, and `TmdbConfig.tsx`).
**Learning:** Using `type="text"` for credentials exposes the raw secret on the user's screen (shoulder-surfing risk) and allows browsers to store and auto-suggest the values in the future via their built-in autofill mechanisms, creating a client-side leakage risk.
**Prevention:** Always use `type="password"` combined with `autoComplete="off"` when rendering inputs that collect or display sensitive user credentials, API keys, or passkeys, even when they are part of a general configuration panel and not a traditional login form.
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

While autoComplete="off" is a good start, autoComplete="new-password" is often more effective for sensitive configuration fields. Modern browsers sometimes ignore off for password fields to ensure password managers can function, whereas new-password explicitly signals that the browser should not attempt to autofill the field with existing site credentials.

Suggested change
**Prevention:** Always use `type="password"` combined with `autoComplete="off"` when rendering inputs that collect or display sensitive user credentials, API keys, or passkeys, even when they are part of a general configuration panel and not a traditional login form.
**Prevention:** Always use `type="password"` combined with `autoComplete="new-password"` when rendering inputs that collect or display sensitive user credentials, API keys, or passkeys, even when they are part of a general configuration panel and not a traditional login form.

<input
type="text"
type="password"
autoComplete="off"
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

For sensitive API keys in configuration panels, autoComplete="new-password" is generally preferred over autoComplete="off". This prevents browsers from incorrectly associating this field with the user's account password for the application and attempting to autofill it.

Suggested change
autoComplete="off"
autoComplete="new-password"

<input
type="text"
type="password"
autoComplete="off"
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

Using autoComplete="new-password" is more reliable than off for preventing unwanted browser autofill on sensitive configuration inputs.

Suggested change
autoComplete="off"
autoComplete="new-password"

<input
type="text"
type="password"
autoComplete="off"
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

Suggesting new-password to better prevent browser autofill interference.

Suggested change
autoComplete="off"
autoComplete="new-password"

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