function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Vasu_vVasu_v 

File Preview Security Risk

Hi All,
We are using custom site to upload the file and we have the feature to preview the file after uploading the file.
and our security team detected that from Burfsuite we can get the base64 image id and using that id in online we can decode to image and can see the actual image.
does anyone is there any way to prevent this issue
below is code that we are currently converting image into base64 

Blob imgData = [SELECT Id, Body, ContentType, BodyLength FROM Attachment WHERE Id=:attachmentId].Body;
        String base64 = EncodingUtil.base64Encode(imgData);       
        return base64;
 
AnkaiahAnkaiah (Salesforce Developers) 
Hi Vasu,

Can you the below help article.
https://help.salesforce.com/s/articleView?id=sf.admin_files_type_security.htm&type=5

If this helps, please mark it as best answer.

Thanks!!