Open-source AI browser agent for Chrome and Firefox (monorepo) ðŸ§
JavaScript ai-agentai-agentsai-toolsbrowser-aibrowser-automationbrowser-extensionchrome-aichrome-devtoolschrome-extensionchrome-extensionsfirefox-addonfirefox-addonsfirefox-extensionfirefox-extensionsgemmagemma4minimaxoffline-aioffline-llmqwen
fix(sidepanel): redact ticket and credential URL parameter names
Emre Sokullu4a37b42018a4
diff --git a/src/chrome/src/ui/sidepanel.js b/src/chrome/src/ui/sidepanel.jsindex c83c58e42..3939c46f0 100644--- a/src/chrome/src/ui/sidepanel.js+++ b/src/chrome/src/ui/sidepanel.js@@ -2990,7 +2990,7 @@ const TOOL_KEYS = {carousel_navigate: 'tool.navigate',};-const SENSITIVE_PARAM_WORDS_RE = /(?:^|[^a-z0-9])(?:key|api[_-]?key|token|secret|password|passwd|pwd|session|otp|signature|sig|auth|authorization|code)(?:[^a-z0-9]|$)/i;+const SENSITIVE_PARAM_WORDS_RE = /(?:^|[^a-z0-9])(?:key|api[_-]?key|token|secret|password|passwd|pwd|session|otp|signature|sig|auth|authorization|code|ticket|jwt|bearer|credential|credentials)(?:[^a-z0-9]|$)/i;// Strip credentials (userinfo, sensitive query/fragment values) before a URL// is shown in the always-visible step label. The full value stays behind thediff --git a/src/firefox/src/ui/sidepanel.js b/src/firefox/src/ui/sidepanel.jsindex b4ad28876..83c7daefe 100644--- a/src/firefox/src/ui/sidepanel.js+++ b/src/firefox/src/ui/sidepanel.js@@ -2851,7 +2851,7 @@ const TOOL_KEYS = {carousel_navigate: 'tool.navigate',};-const SENSITIVE_PARAM_WORDS_RE = /(?:^|[^a-z0-9])(?:key|api[_-]?key|token|secret|password|passwd|pwd|session|otp|signature|sig|auth|authorization|code)(?:[^a-z0-9]|$)/i;+const SENSITIVE_PARAM_WORDS_RE = /(?:^|[^a-z0-9])(?:key|api[_-]?key|token|secret|password|passwd|pwd|session|otp|signature|sig|auth|authorization|code|ticket|jwt|bearer|credential|credentials)(?:[^a-z0-9]|$)/i;// Strip credentials (userinfo, sensitive query/fragment values) before a URL// is shown in the always-visible step label. The full value stays behind thediff --git a/test/run.js b/test/run.jsindex ea8c95491..c59b74796 100644--- a/test/run.js+++ b/test/run.js@@ -45069,6 +45069,7 @@ test('sidepanel friendlyToolLabel localizes get_accessibility_tree and actions aassert.match(panel, /SENSITIVE_PARAM_WORDS_RE/, `${label}: URL credential redaction must inspect sensitive parameter names`);assert.match(panel, /signature\|sig/, `${label}: URL credential redaction must cover signatures`);assert.match(panel, /authorization\|code/, `${label}: URL credential redaction must cover auth code`);+ assert.match(panel, /ticket\|jwt\|bearer\|credential/, `${label}: URL credential redaction must cover tickets, tokens, and credentials`);assert.match(panel, /redactUrlForLabel\(args\.url\)/, `${label}: fetch/research labels must redact URL credentials`);assert.match(panel, /function isTerminalDoneTool\(name\)/, `${label}: done_json must share terminal completion handling`);assert.match(panel, /function restoreStepFriendlyLabel\(step\)/, `${label}: completed/failed steps must restore friendly label and clear progress marker`);