Skip to content

Commit 951ae8c

Browse files
committed
update to allowlist
1 parent 52215d5 commit 951ae8c

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

client/src/pages/TriggerWorkflowForm/TriggerWorkflowForm.jsx

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,19 @@ const TriggerWorkflowForm = () => {
1919

2020
const triggerUrlPattern = /^https:\/\/(?!.*javascript)[^()]+$/i;
2121

22-
function isValidTriggerUrl(url) {
23-
try {
24-
// Check if it's a valid URL and matches the pattern
25-
return triggerUrlPattern.test(decodeURIComponent(url)) && new URL(url);
26-
} catch {
27-
return false;
28-
}
22+
function isValidTriggerUrl(url) {
23+
try {
24+
const decoded = decodeURIComponent(url);
25+
const parsedUrl = new URL(decoded);
26+
// Only allow https and the exact hostname
27+
return (
28+
parsedUrl.protocol === 'https:' &&
29+
parsedUrl.hostname === 'apps-d.docusign.com'
30+
);
31+
} catch {
32+
return false;
2933
}
34+
}
3035

3136
if (triggerUrl !== null && isValidTriggerUrl(triggerUrl)) {
3237
return (

0 commit comments

Comments
 (0)