Improve security in attachments view