top of page

Avoid Using eval() in Script

Using eval() in scripts can execute untrusted or malicious code, posing significant security risks. It can lead to code injection vulnerabilities, making the system susceptible to attacks and compromising data integrity.


Resolution Steps

  1. Remove eval() from Scripts

    • Avoid using eval() to execute dynamically generated JavaScript code.

    • Instead, use safer alternatives that provide controlled execution.

  2. Use GlideScriptEvaluator Instead

    • If executing arbitrary code is necessary, store the script in a trusted record and use GlideScriptEvaluator.

    • This ensures that the executed code is validated and sourced securely.


Before:

o	Avoid using eval() to execute dynamically generated JavaScript code.
Avoid using eval() to execute dynamically generated JavaScript code.

After:

o	If executing arbitrary code is necessary, store the script in a trusted record and use GlideScriptEvaluator.
If executing arbitrary code is necessary, store the script in a trusted record and use GlideScriptEvaluator.

Removing eval() from scripts reduces security risks and prevents potential attacks. Using GlideScriptEvaluator ensures safe execution of necessary scripts.


For more detailed guidance on resolving this issue, please contact us at support@dt-advisory.ch.

bottom of page