unsafe-eval issue in plugins | Community
Skip to main content
January 6, 2025
Solved

unsafe-eval issue in plugins

  • January 6, 2025
  • 2 replies
  • 852 views

Hi,

 
Currently we consume Adobe Analytics from our scripts and there's no issue with loading those overall. But we have issues with the plugins. All of those plugins are loaded using 'new Function()' javascript and that is considered unsafe-eval.
 
What can be done to resolve the issue?
 
Thanks.
Best answer by bjoern__koth

I checked with @jane_12 and it seems like the have super old AppMeasurement plugin code in place that actually uses this construct.

s.apl = new Function(...)

 

Recommended her to update her plugin versions or change to 

 

s.apl = function(...)

2 replies

bjoern__koth
Community Advisor and Adobe Champion
Community Advisor and Adobe Champion
January 6, 2025

Hi @jane_12 ,

which plugins are you referring to? I checked a couple of my clients and cannot find the expression

new Function()

anywhere in the code loaded through Launch neither the core nor additionally loaded scripts.


If you like, you can send me a DM with your client's URL

Cheers from Switzerland!
Jennifer_Dungan
Community Advisor and Adobe Champion
Community Advisor and Adobe Champion
January 6, 2025

This almost sounds like your developer changed the code of the plugins... Like @bjoern__koth , I have never seen the use of "new function()" in any of the Adobe provided code... 

 

Are you sure these are specifically plugins? Or maybe this is being used in custom code (data Elements or Actions, etc)?

 

Like Bjorn, if you are willing to share a URL via private messaging, I would also be happy to take a look and offer suggestions on how to fix.

bjoern__koth
Community Advisor and Adobe Champion
bjoern__kothCommunity Advisor and Adobe ChampionAccepted solution
Community Advisor and Adobe Champion
January 7, 2025

I checked with @jane_12 and it seems like the have super old AppMeasurement plugin code in place that actually uses this construct.

s.apl = new Function(...)

 

Recommended her to update her plugin versions or change to 

 

s.apl = function(...)

Cheers from Switzerland!