glide.script.enforce_scope_checks_on_get_ref_record: cross-scope checks for getRefRecord() in ServiceNow Brazil
The ServiceNow Brazil release (November 2026) adds a system property that applies cross-scope access checks to getRefRecord(). It is on by default on new Brazil instances and off on upgraded instances, so most existing customers have to decide when to switch it on. This page explains what the property does, how to find scripts it could affect, and how to enable it safely.
Read KB3142985 before you enable the property. ServiceNow points to it for how the enhancement works and for guidance on assessing and remediating cross-scope getRefRecord() access. It is on the ServiceNow support portal and needs a login.
This page is based on ServiceNow's customer communication about the property, the description of the property record on a Brazil instance and the related dot-walking protections from KB2793170. The property is not in the public product documentation yet.
Spotted a mistake, or know a setting that belongs here? Send me a message and I will update the page.
What the property does
getRefRecord() returns the record a reference field points to, for example current.assignment_group.getRefRecord(). If that record lives in a table of another application scope, the call crosses a scope boundary.
glide.script.enforce_scope_checks_on_get_ref_record decides whether cross-scope access checks apply to that call. The property record calls true the safe value: cross-scope access checks are enforced, an unauthorized call returns null and the platform logs an access violation. With false, the record calls it unsafe, no cross-scope check is made.
The property extends the dot-walking scope protections that came with Australia (KB2793170, Dot-Walk Scoping Security Enhancement). Those checks cover reading data through dot-walking across a reference field. This property closes the same gap for getRefRecord().
- New Brazil instances: the property is
true, so the checks are on from the start. - Upgraded instances: the property is
false, so the behavior stays as it was before the upgrade until you change it. - Check the value on your own instance with the script under Check your instance. A sub-production instance cloned from production has the production value.
| Property | Default | Typical setting | What it does |
|---|---|---|---|
glide.script.enforce_scope_checks_on_get_ref_record |
true |
true, after testing | Enforces cross-scope access checks when a script calls getRefRecord() on a reference field. With true, unauthorized calls return null and log an access violation. New in Brazil: true by default on new Brazil instances, false on upgraded instances. |
Assess and fix affected scripts
Scripts are at risk when they call getRefRecord() on a reference field whose target table belongs to a different application scope than the script, and that access is not authorized. Once the property is true, such a call returns null instead of the record. Code that uses the result without a null check then fails or silently skips its work.
The read-only script below lists server-side scripts that contain getRefRecord, with their table, name and scope. It is a starting point, not a full inventory: it does not cover every table that can hold a script.
- Run the search script below on a sub-production instance and note every hit in a scoped application, plus global scripts that read records of scoped tables.
- For each hit, check the scope of the referenced table. Calls that stay inside one scope are not affected by a cross-scope check.
- Fix the access as described in KB3142985, and make sure the script handles a
nullresult instead of assuming a record. - Look at the dot-walking checks from Australia at the same time. The same scripts often dot-walk across scopes as well, and the properties in the table below control those checks.
Read only: lists server-side scripts that call getRefRecord(), with their scope. Run it in System Definition > Scripts - Background.
// Read only: lists scripts that contain getRefRecord, with table, name and scope.
// Run in System Definition > Scripts - Background on a sub-production instance.
var sources = [
['sys_script_include', 'script'],
['sys_script', 'script'],
['sys_ui_action', 'script'],
['sysauto_script', 'script'],
['sys_script_fix', 'script'],
['sys_ws_operation', 'operation_script'],
['sp_widget', 'script'],
['sys_transform_script', 'script']
];
var total = 0;
for (var i = 0; i < sources.length; i++) {
var table = sources[i][0], field = sources[i][1];
if (!gs.tableExists(table)) continue;
var gr = new GlideRecord(table);
gr.addQuery(field, 'CONTAINS', 'getRefRecord');
gr.query();
while (gr.next()) {
total++;
gs.print(table + ' | ' + gr.getDisplayValue() + ' | scope: ' + gr.getDisplayValue('sys_scope') + ' | ' + gr.getUniqueValue());
}
}
gs.print(total + ' script(s) found');| Property | Default | Typical setting | What it does |
|---|---|---|---|
glide.script.dot_walk.enforce_cross_scope_access_all_tables |
true |
true | Enforces authorization checks for cross-scope table data accessed through dot-walking. With the default value of true, checks apply to all tables unless a table explicitly disables them with its dictionary attribute. |
glide.script.dot_walk.log_and_allow_violations |
Not stated | false, once violations are fixed | Allows cross-scope dot-walk access to unauthorized tables while logging access violations. When enabled, access proceeds without authorization checks; when disabled, enforcement follows the cross-scope access setting. |
glide.script.dot_walk.log_stack_trace_when_blocked |
true |
true while you test | Adds a full stack trace to log messages when dot-walk access to a protected table is blocked. With the default value of true, blocked access logs include the trace; setting it to false leaves only the brief informational message. |
glide.script.dot_walk.exempt_script_sources |
sys_declarative_action_assignment |
Leave as delivered | Sets which script sources are exempt from scoping checks during dot-walking. By default, `sys_declarative_action_assignment` is exempt, while other sources remain subject to those checks. |
glide.script.dot_walk.add_attribute_on_table_create |
true |
Leave as delivered | Adds a dictionary attribute to new tables to enforce cross-scope access checks during dot-walking through reference fields. With the default value of true, newly created tables receive this enforcement attribute; tables created before zBoot are not affected. |
Enable the property
On an upgraded instance the property is false. Enabling it is a change of one value, so you can roll it back the same way.
- Read KB3142985 and finish the assessment above on a sub-production instance.
- Open
sys_properties.list, filter on Name isglide.script.enforce_scope_checks_on_get_ref_recordand set Value totrue. - Run the affected scripts, flows and integrations and check the system log for access violations. Each one points to a
getRefRecord()call that now returnsnull. - Fix what you find, then make the same change in production, ideally through an update set or your normal release process.
- If something breaks in production, set the value back to
falseand fix the script on sub-production first.
| Property | Default | Typical setting | What it does |
|---|---|---|---|
glide.script.enforce_scope_checks_on_get_ref_record |
true |
true | Enforces cross-scope access checks when a script calls getRefRecord() on a reference field. With true, unauthorized calls return null and log an access violation. New in Brazil: true by default on new Brazil instances, false on upgraded instances. |
Check your instance
Paste this read-only background script into System Definition > Scripts - Background on a sub-production instance. It prints the current value of every property in this guide. A property without a record runs on its platform default. You can also open sys_properties.list and filter by name.
// Read only: prints the current value of every property in this guide.
// Run in System Definition > Scripts - Background.
var names = [
'glide.script.enforce_scope_checks_on_get_ref_record',
'glide.script.dot_walk.enforce_cross_scope_access_all_tables',
'glide.script.dot_walk.log_and_allow_violations',
'glide.script.dot_walk.log_stack_trace_when_blocked',
'glide.script.dot_walk.exempt_script_sources',
'glide.script.dot_walk.add_attribute_on_table_create'
];
var found = {};
var gr = new GlideRecord('sys_properties');
gr.addQuery('name', 'IN', names.join(','));
gr.query();
while (gr.next()) {
found[gr.getValue('name')] = gr.getValue('value');
}
for (var i = 0; i < names.length; i++) {
var n = names[i];
gs.print(n + ' = ' + (found.hasOwnProperty(n) ? found[n] : '(no record on this instance, platform default applies)'));
}FAQ
What does glide.script.enforce_scope_checks_on_get_ref_record do?
It controls whether cross-scope access checks apply when a script calls getRefRecord() on a reference field. With true, an unauthorized cross-scope call returns null and logs an access violation. With false, no cross-scope check is made.
What is the default value of glide.script.enforce_scope_checks_on_get_ref_record?
It depends on how the instance got to Brazil. New Brazil instances have it set to true. Instances upgraded to Brazil have it set to false, so their behavior does not change until an admin enables it.
Which ServiceNow release added this property?
Brazil. It extends the dot-walking scope protections that came with the Australia release, described in KB2793170 (Dot-Walk Scoping Security Enhancement).
What happens to my scripts when I enable it?
A script that calls getRefRecord() across a scope boundary without authorization gets null instead of the referenced record, and an access violation is logged. Scripts that only read records in their own scope are not affected by the cross-scope check.
What should I do before enabling it?
Review KB3142985, as ServiceNow asks. Then search your scripts for getRefRecord(), test the scoped applications that use it on a sub-production instance with the property set to true, and fix every logged access violation before you change production.
Can I turn it off again?
Yes. It is a normal system property, so setting the value back to false in sys_properties switches the check off again.
Where do I get help from ServiceNow?
ServiceNow asks customers to open a case in Now Support with the subject "Cross-Scope Access Security Enhancement (Glide Element API: getRefRecord())".
Related
Something wrong or missing on this page? Tell me and I will fix it.
Send feedback