Skip to content

Open-source AI browser agent for Chrome and Firefox (monorepo) 🧠

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.js
index 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 the
diff --git a/src/firefox/src/ui/sidepanel.js b/src/firefox/src/ui/sidepanel.js
index 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 the
diff --git a/test/run.js b/test/run.js
index ea8c95491..c59b74796 100644
--- a/test/run.js
+++ b/test/run.js
@@ -45069,6 +45069,7 @@ test('sidepanel friendlyToolLabel localizes get_accessibility_tree and actions a
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, /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`);