Varonis Finds ServiceNow Roles Can Enable Administrator Session Hijacking

· Original article ↗

Summary

Varonis Threat Labs reports that ServiceNow’s template_editor with ITIL and sn_nowassist_admin roles can be used to capture another user’s session through scripts in templates or Now Assist actions. ServiceNow fixed the demonstrated sandbox escape, but the article says’

Key points

  • Varonis Threat Labs reports that users with template_editor and ITIL can add JavaScript to a shared incident template; when another user applies it, the script runs in that user’s session context.
  • The researchers describe using a JavaScript constructor-chain sandbox escape to reach GlideTransaction and read the victim’s cookie and X-UserToken from request headers.
  • The article describes a second path using the sn_nowassist_admin role to create a Now Assist quick action and an incident-form button that captures session material when clicked.
  • The researchers say captured cookies and tokens can be replayed as the victim, potentially including an administrator; this is a reported research finding, not evidence of a real-world compromise.
  • ServiceNow fixed the demonstrated constructor.constructor sandbox-escape technique. The article also says template scripts are evaluated with sandbox enforcement on patched instances, while describing the broader risk of executable template and quick-action code.
  • Recommended measures include restricting who can edit shared templates and quick actions, reviewing their scripts as privileged code, alerting on scripts that access authentication headers, and monitoring session activity.

Article Details

Attack Vectors
  • A user with the template_editor and ITIL roles can modify a shared incident template to execute JavaScript when another user applies it, causing code to read that user's session cookie and security token.
  • A user with the sn_nowassist_admin role can create a server-side quick action and an incident-form button that silently captures the clicking user's session cookie and token.
  • The attacker can retrieve captured session material from an incident field or writable quick-action record and replay it to act as the victim.
  • The article describes adding a business rule after obtaining an administrator session to harvest session material again on future logins.
Defensive Notes
  • Treat executable template fields and quick-action scripts as privileged code and subject them to code review.
  • Restrict and review assignments of template_editor, ITIL, and sn_nowassist_admin, including who can edit shared templates and quick actions.
  • Alert on scripts that read x-usertoken, cookie, or Authorization headers outside an approved allowlist.
  • Restrict and log background-script console access, and alert on script executions.
  • Monitor for runtime redefinition of JavaScript built-in prototype methods and for session anomalies such as unexpected IP addresses or device changes.
  • Limit administrator and other highly privileged access to trusted subnets using ServiceNow IP Access Controls.

MITRE ATT&CK

Vendors

Products

Related Articles