Accessing attachments from the domain only
-
Links to attached files are in the following format:
https://www.example.com/?wpsc_attachment=1&tid=1&tac=9bNVzXo6kd
Links to inline images are in the following format:
https://www.example.com/?wpsc_img_attachment=1
If I paste these links in my browser I get served with the image and the attachment, without being logged in.
I want to prevent people from accessing these attachments from outside my domain, i.e. I only want them to be accessible to customers and agents if they click on the links from the ticket view.
This is a big privacy/security concern for me. I don’t really want the attachments and images being accessible from notification emails either. I don’t want anyone fishing for what images and files may have been attached to tickets.
Am I concluding correctly that SupportCandy does not check if a user is logged in (or what privileges it has) before returning images and attachments?
Can you suggest some ways as to how to prevent both direct and non-logged-in access? An option I’m thinking of might be to use this in
.htaccess
:RewriteCond %{HTTP_REFERER} !^https://www\.example\.com/ [NC]
RewriteCond %{QUERY_STRING} ^wpsc_attachment=([0-9]+) [NC,OR]
RewriteCond %{QUERY_STRING} ^wpsc_img_attachment=([0-9]+) [NC]
RewriteRule (.*) - [R=404]
If you have some suggestions for some better rules above, please let me know!
Cheers
- The topic ‘Accessing attachments from the domain only’ is closed to new replies.