hm-redirects icon indicating copy to clipboard operation
hm-redirects copied to clipboard

Add a UI for allowed redirect domains

Open roborourke opened this issue 6 years ago • 7 comments

Whitelisted redirect domains are defined via a filter right now. It'd be useful to have a UI for this to remove the need for developer involvement to unblock marketing teams.

As an aside we could look at filtering the allowed domains just in time based on the redirect target. From a security standpoint if a bad actor is able to create a redirect they would presumably be able to update a stored domain whitelist as well unless we create a custom permission for admins / super admins only.

roborourke avatar May 21 '19 11:05 roborourke

We should probably also display in the UI if a redirect won't be handled because the URL doesn't validate.

rmccue avatar May 31 '19 13:05 rmccue

IMO, we should disable the domain validation entirely.

rmccue avatar Jan 31 '20 17:01 rmccue

It'd make life a lot easier for marketing team members. There is the security trade off to consider though, perhaps we can build that part into Altis using a notification - if a new domain is added a site admin is asked to approve it by clicking a notification action.

roborourke avatar Jan 31 '20 17:01 roborourke

I don't think there's a huge security concern, IMO.

wp_validate_redirect (and its counterpart, wp_safe_redirect) are specifically for the places in WP where open redirects exist. wp-login.php for example takes a redirect_to query param that could be used to send you anywhere.

In our case though, redirects have to be created by people with the capability to do so, and are static, so I don't think we need this strict validation.

rmccue avatar Jan 31 '20 17:01 rmccue

I'm inclined to agree but there may be things we haven't considered like compliance / findings from ethical hacking audits - @fklein-lu made it this way originally for a reason.

roborourke avatar Feb 03 '20 11:02 roborourke

In my experience of using it so far, I get tripped up every time it doesn't actually redirect.

I'm going to remove the use of wp_validate_redirect per above, as it's not the appropriate function to use here.

rmccue avatar Feb 24 '20 14:02 rmccue

Hit by this, and by the fact the find-domains only lists the found domains, not trusts them, so the redirect doesn't work. Will use the workaround.

svandragt avatar Nov 08 '22 14:11 svandragt