T09 · Insecure Skill Coding Practices
- Location
references/v1.5.0/patch-auth-badge.txt:36- Finding
Authentication Profile Identifiers Are Exposed to UI Clients
- Content
View full analysis
{ try { const store = loadAuthProfileStore(); const lastGood = store?.lastGood ?? {}; const profiles = store?.profiles ?? {}; const anthropicProfileId = lastGood["anthropic"] ?? null; const cred = anthropicProfileId ? profiles[anthropicProfileId] : null; let mode: "oauth" | "api" | "fallback" | "unknown" = "unknown"; if (cred?.type === "token") { mode = "oauth"; } else if (cred?.type === "api_key" && anthropicProfileId?.startsWith("anthropic:")) { mode = "api"; } else if (anthropicProfileId && !anthropicProfileId.startsWith("anthropic:")) { mode = "fallback"; } respond(true, { profileId: anthropicProfileId, mode }, undefined); } catch (err) { respond(false, undefined, String(err)); } }, ``` ```ts function renderAuthBadge(profileId: string | undefined, role: string) { if (role !== "assistant" || !profileId) { return nothing; } let label: string; let cls: string; // Handle fallback mode hint (e.g. "__mode:oauth") if (profileId.startsWith("__mode:")) { const mode = profileId.slice(7); if (mode === "oauth") { label = "OAuth"; cls = "auth-badge auth-badge--oauth"; } else if (mode === "api") { label = "API"; cls = "auth-badge auth-badge--api"; } else { label = "Fallback"; cls = "auth-badge auth-badge--fallback"; } } else if (profileId.includes(":manual") || ...[truncated 2438 chars]- Remediation
View remediation
