File tree Expand file tree Collapse file tree 1 file changed +12
-7
lines changed
client/src/pages/TriggerWorkflowForm Expand file tree Collapse file tree 1 file changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -19,14 +19,19 @@ const TriggerWorkflowForm = () => {
19
19
20
20
const triggerUrlPattern = / ^ h t t p s : \/ \/ (? ! .* j a v a s c r i p t ) [ ^ ( ) ] + $ / i;
21
21
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 ;
29
33
}
34
+ }
30
35
31
36
if ( triggerUrl !== null && isValidTriggerUrl ( triggerUrl ) ) {
32
37
return (
You can’t perform that action at this time.
0 commit comments