Eval is strongly discouraged

Hi


We found that the File Manager component has dependency on the EJ2 - and we find that is a security issue.


How we can disable the eval ? It is a security issue.


Thanks


1 Reply

SS Sivakumar ShunmugaSundaram Syncfusion Team September 20, 2022 01:21 PM UTC

Hi Michel,


Greetings from Syncfusion support.


As per the shared details, we understand that you want to implement the React FileManager component without using "unsafe-eval" content in the CSP meta tag.


In general, while the template is applied to the Syncfusion components, you must add the 'unsafe-eval' comment. If strict Content-Security-Policy (CSP) mode is enabled, then eval() will be blocked, but only using this will we perform dynamic code evaluation.


Also, our File Manager is integrated using dependent components such as TreeView, Dialog, Grid, and Toolbar, which include templates, and this is the reason we are facing issues while avoiding "unsafe-eval" in the meta tag. To overcome this issue, we suggest you use the below meta tag to avoid adding additional script injections.


This meta tag will allow only the Syncfusion scripts and the scripts referenced in the local sample. The sample will not accept any additional outside scripts. We have attached the modified sample to your reference.


[index.html]

 

    <meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-eval' https://cdnjs.cloudflare.com/ https://cdn.syncfusion.com; style-src 'self' https://fonts.googleapis.com/ https://cdn.syncfusion.com 'unsafe-inline'; font-src 'self' https://fonts.googleapis.com/ https://fonts.gstatic.com/ data: cdn.syncfusion.com 'unsafe-inline';">

 


Sample: https://www.syncfusion.com/downloads/support/directtrac/general/ze/EJ2-React-Dynamic-theme-Switch-1322581004.zip


Note: To remove the license warning you need to register your license otherwise while you will get an error while closing the warning.


Please check the attached sample and get back to us if you need any further assistance.


Regards,

Sivakumar S



Loader.
Up arrow icon