We have a Second Generation Managed Package where we need to get the data from a JSON file. So using apex we are able access data of the JSON files having size less than 6 MB due to the heap size limit of a Synchronous apex call. Our file size will be around 9 MB. So to access the data in JSON file, we thought using the getrecord UI Wire Adaptor approach mentioned in this link. So in this approach we need to use the atob js function to convert the base64 file content to the JSON string and again parse the string. So using the atob and btoa js functions and loading the files using the getrecord UI Wire Adaptor will have any impact on the Salesforce Security Review.
1 Answer
atob
and btoa
are not a security concern, and won't subsequently affect a Security Review.
-
Thanks for the reply @sfdcfox. Will that approach (getting files through getrecord UI wire adaptor) pose any security issues?– S1thCommented Jan 1 at 8:50
-
1There are no security concerns directly, though there could be problems with the way you subsequently use the JSON content and how you deal with content that is not JSON.– Phil WCommented Jan 1 at 10:58
-
2@S1th As I said, the act of converting to and from binary files isn't a security risk. As PhilW said, what you do with that data may be a security issue (e.g. calling
eval
might somehow present a security risk), though this is largely mitigated by Locker Service/Locker Web Security.– sfdcfox ♦Commented Jan 1 at 15:23 -
-
Thanks @Phil W, we are using the JSON to store the information and we are not using eval function.– S1thCommented Jan 3 at 11:59