{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":41438,"path":"platform-security/instance-security-hardening-settings/sc-escape-jelly.md","title":"Escape jelly script \\[Updated in Security Center 1.3 and 1.5\\]","bundle":null,"doc_type":null,"release":"australia","body":"\n# Escape jelly script \\[Updated in Security Center 1.3 and 1.5\\]\n\nUse the **glide.ui.escape\\_all\\_script** property to force escape of all scripts injected into Jelly.\n\nThis property escapes all the JS and HTML strings included in &lt;j:jelly&gt; ... &lt;/j:jelly&gt; before they are written to the output stream, preventing several XSS issues from occurring. If **glide.ui.escape\\_all\\_script** is not set to the recommended value of true, then escaping of scripts injected into Jelly is disabled. Without this mitigation, the platform becomes widely open to a variety of script injection attacks. An attacker could execute arbitrary Rhino scripts on the instance.\n\n**Warning:** Be careful when using these tags. If user input is displayed here it can open a security vulnerability.\n\n## More information\n\n<table id=\"table_ajc_b43_3kb\"><thead><tr><th>\n\nAttribute\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nProperty name\n\n</td><td>\n\n**glide.ui.escape\\_all\\_script**\n\n</td></tr><tr><td>\n\nConfiguration type\n\n</td><td>\n\nSystem Properties \\(/sys\\_properties\\_list.do\\)\n\n</td></tr><tr><td>\n\nData type\n\n</td><td>\n\nBoolean\n\n</td></tr><tr><td>\n\nCategory\n\n</td><td>\n\n[Validation, sanitization, and encoding](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/platform-security/instance-security-hardening-settings/validation-sanitization-encoding.md)\n\n</td></tr><tr><td>\n\nPurpose\n\n</td><td>\n\nIf the property is not set to **true**, developers have to perform several steps on each custom Jelly script to prevent XSS issues. These steps include locating the Jelly variables being sent to output stream to render on web pages, and performing escaping on each of the following tags:\n\n `$â {JS:expression}`\n\n `$â {HTML:expression}`\n\n OR\n\n `$â {JS,HTML:expression}`\n\n</td></tr><tr><td>\n\nRecommended value\n\n</td><td>\n\ntrue\n\n</td></tr><tr><td>\n\nDefault value\n\n</td><td>\n\ntrue\n\n</td></tr><tr><td>\n\nSecurity risk rating\n\n</td><td>\n\n7.3\n\n</td></tr><tr><td>\n\nFunctional impact\n\n</td><td>\n\nThis remediation enforces Jelly escaping at the parser level. It can have a functionality impact on user interaction with the resulting data.\n\n</td></tr><tr><td>\n\nSecurity risk\n\n</td><td>\n\n\\(High\\) Input validation has to occur on all the user input being entered on the application. By doing so, injection attacks against the platform can be defended and protected.\n\n</td></tr><tr><td>\n\nWorkaround\n\n</td><td>\n\nThe UI may be affected because some of the scripts and HTML tags designed for rendering on a web page may appear broken. This remediation sends the output encoded page to the browser to render.\n\n For example, instead of `'my string here'`, it might display '`<u>my string here</u>` as the `<u>` tag was properly escaped. In this case, to prevent escaping, add the NOESC prefix to Jelly expression to prevent JS escaping. For example:\n\n-   Before: \\($\\[jvar\\_context\\_menus\\]\\);\n-   After: `($[NOESC:jvar_context_menus]);`\n-   Before: $\\[jvar\\_ui\\_policy\\_scripts\\]\n-   After: `$[NOESC:jvar_ui_policy_scripts]`\n\n **Warning:** Be careful when using these tags. If user input is displayed here it can open a security vulnerability.\n\n</td></tr><tr><td>\n\nReferences\n\n</td><td>\n\n[High Security Settings](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/platform-security/c_HighSecuritySettings.md)\n\n [Jelly tags](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/api-reference/scripts/r_JellyTags.md)\n\n</td></tr></tbody>\n</table>To learn more about adding or creating a system property, see [Add a system property](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/platform-administration/t_AddAPropertyUsingSysPropsList.md).\n\n**Parent Topic:**[Validation, sanitization, and encoding](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/platform-security/instance-security-hardening-settings/validation-sanitization-encoding.md)\n\n"}}