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 = () => {
1919
2020 const triggerUrlPattern = / ^ h t t p s : \/ \/ (? ! .* j a v a s c r i p t ) [ ^ ( ) ] + $ / 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 (
You can’t perform that action at this time.
0 commit comments