Skip to content

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

fix(sidepanel): redact signature params and supply helpers in isolated test

Emre Sokullu48eb1c3a9645
diff --git a/src/chrome/src/ui/sidepanel.js b/src/chrome/src/ui/sidepanel.js
index ba1b10ad4..139541811 100644
--- a/src/chrome/src/ui/sidepanel.js
+++ b/src/chrome/src/ui/sidepanel.js
@@ -2988,7 +2988,7 @@ const TOOL_KEYS = {
carousel_navigate: 'tool.navigate',
};
-const SENSITIVE_URL_PARAM_RE = /([#?&][^#&?=]*?(?:token|auth|api[_-]?key|secret|password|passwd|pwd|session|otp)[^#&?=]*=)[^#&\s]*/gi;
+const SENSITIVE_URL_PARAM_RE = /([#?&](?:[^#&?=]*?[_.-])?(?:token|auth|api[_-]?key|secret|password|passwd|pwd|session|otp|signature|sig)(?:[_.-][^#&?=]*)?=)[^#&\s]*/gi;
// 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 8c667ca73..bce158b50 100644
--- a/src/firefox/src/ui/sidepanel.js
+++ b/src/firefox/src/ui/sidepanel.js
@@ -2849,7 +2849,7 @@ const TOOL_KEYS = {
carousel_navigate: 'tool.navigate',
};
-const SENSITIVE_URL_PARAM_RE = /([#?&][^#&?=]*?(?:token|auth|api[_-]?key|secret|password|passwd|pwd|session|otp)[^#&?=]*=)[^#&\s]*/gi;
+const SENSITIVE_URL_PARAM_RE = /([#?&](?:[^#&?=]*?[_.-])?(?:token|auth|api[_-]?key|secret|password|passwd|pwd|session|otp|signature|sig)(?:[_.-][^#&?=]*)?=)[^#&\s]*/gi;
// 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 a84a9753b..a9a67a285 100644
--- a/test/run.js
+++ b/test/run.js
@@ -45064,6 +45064,7 @@ test('sidepanel friendlyToolLabel localizes get_accessibility_tree and actions a
assert.match(panel, /refreshRenderedStepLabels\(\);/, `${label}: locale-change handler must refresh rendered step labels`);
assert.ok((panel.match(/refreshRenderedStepLabels\(\);/g) || []).length >= 4, `${label}: restored transcripts must refresh step labels on every restore path`);
assert.match(panel, /function redactUrlForLabel\(url\)/, `${label}: URL step labels must redact credentials`);
+ assert.match(panel, /signature\|sig/, `${label}: URL credential redaction must cover signatures`);
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, /label\.textContent = friendlyToolLabel\(toolName, stepArgs\);/, `${label}: completed steps must restore the friendly label after progress`);
@@ -52835,6 +52836,8 @@ test('activity results settle matching steps and preserve completion outcomes',
escapeHtml: (value) => String(value),
truncate: (value) => String(value),
t: (key) => key,
+ isTerminalDoneTool: (name) => name === 'done' || name === 'done_json',
+ friendlyToolLabel: (name, args) => name,
},
);