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 bracketed credentials and OAuth auth-code params
Emre Sokullu6762ff075bd7
diff --git a/src/chrome/src/ui/sidepanel.js b/src/chrome/src/ui/sidepanel.jsindex 6d5e1e81a..c83c58e42 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 = /(?:^|[_-])(?:key|api[_-]?key|token|secret|password|passwd|pwd|session|otp|signature|sig|auth|authorization)(?:[_-]|$)/i;+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;// 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 9202ce6cd..b4ad28876 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 = /(?:^|[_-])(?:key|api[_-]?key|token|secret|password|passwd|pwd|session|otp|signature|sig|auth|authorization)(?:[_-]|$)/i;+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;// 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 c17b2d384..ea8c95491 100644--- a/test/run.js+++ b/test/run.js@@ -45068,6 +45068,7 @@ test('sidepanel friendlyToolLabel localizes get_accessibility_tree and actions aassert.match(panel, /decodeURIComponent/, `${label}: URL credential redaction must decode parameter names`);assert.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, /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`);