Allow JavaScript tags in embedded HTML (instance security hardening)

  • Release version: Washingtondc
  • Updated February 1, 2024
  • 1 minute to read
  • The glide.ui.security.codetag.allow_script property disables support for embedding HTML JavaScript code created using of the [code] tag.

    Note:
    This property is set to false by default in Vancouver and later releases, and can't be changed by administrators. For a use case where the property has to be changed, contact customer support.
    The ServiceNow AI Platform mitigates many injection and cross-site attacks by implementing escaping and encoding techniques. As a result, users can't write and submit HTML formatted inputs for journal fields. However, journal fields can render text enclosed within code tags as HTML.
    • However, there is an associated security risk. If set to true, malicious users can write harmful HTML JavaScript code that may be executed on a different client browser after rendering of journal fields.
    • Set this property to false so that administrators can prevent journal fields from rendering HTML JavaScript code by disabling support for the [code] tag.

    More information

    Attribute Description
    Property name glide.ui.security.codetag.allow_script
    Configuration type System Properties (/sys_properties_list.do)
    Configure in Instance Security Center Yes
    Purpose Protects against cross-site scripting and malicious script execution
    Recommended value false
    Default value false
    Functional ImpactThis remediation enforces JavaScript escaping to occur on the UI and renders the encoded results to the user. It can have a functionality impact based on the instance user interaction with the resulted data.
    Security risk (High) Input validation must occur in the application to defend against cross-site scripting attacks. These attacks enable foreign scripts to execute on the user session in the logged in browser's context. Attackers can use it to steal session information and sensitive data.
    References

    Restrict the CODE tag in journal fields

    Render journal field entries as HTML

    High Security Settings

    To learn more about adding or creating a system property, see Add a system property.