ServiceNow attachment properties: block file types, limit size, control downloads
Most attachment questions come down to a handful of system properties: which file types users may upload, how big a file may be, whether a file opens in the browser or downloads, and who may attach at all. This guide lists them by task, with the documented default, a sensible setting and what to test before you change anything.
Test on a sub-production instance first. Attachment rules apply platform wide, including integrations, inbound email and scheduled exports. A list that is too strict breaks things that are hard to trace back to an attachment setting.
Defaults on this page are the values from the out of the box property record or the ServiceNow documentation. Your instance may have different values, so run the check script below before you plan changes.
Spotted a mistake, or know a setting that belongs here? Send me a message and I will update the page.
Block .exe and other file types
There are two ways to restrict file types. An allow list (glide.attachment.extensions) names the extensions users may upload and rejects everything else. An exclusion list (glide.attachment.blacklisted.extensions and glide.attachment.blacklisted.types, active while glide.security.attachment_type.use_blacklist is true) names what is blocked and lets the rest through.
An allow list is the stronger option, because new or unusual executable formats are blocked without you having to know them. It also needs more upkeep: every file type a team really uses has to be on it. An exclusion list is easier to start with, for example exe,bat,cmd,com,msi,ps1,vbs,js,jar,scr.
Renaming virus.exe to virus.pdf defeats an extension check on its own. MIME type validation compares the file content with its extension and closes that gap, and secure filename validation rejects tricks like double extensions.
- Decide between allow list and exclusion list. Leave
glide.attachment.extensionsblank if you go with an exclusion list, because blank means all extensions are allowed. - Keep
glide.security.file.mime_type.validationontrue(the default) so uploads are checked against their real content. - Turn on
glide.attachment.enable_secure_filename_validationandglide.security.file.mime_type.validation.inbound_emailafter a test, so filenames and email attachments get the same checks. - If you use Studio with Git, do not block
txtorgitdata, or the MIME typestext/plainandapplication/octet-stream. Git operations save those as attachments. - Test an upload of a blocked file through the form, Service Portal, a workspace and inbound email. Each channel can behave differently.
| Property | Default | Typical setting | What it does |
|---|---|---|---|
glide.attachment.extensions |
Empty | e.g. pdf,docx,xlsx,pptx,png,jpg,txt,csv,zip | Restricts attachment dialog uploads to the comma-separated file extensions listed in glide.attachment.extensions. When the property is blank, all file extensions are allowed, so entering extensions narrows the types users can attach. |
glide.security.attachment_type.use_blacklist |
true |
true | Enables validation of file attachments against configured exclusion lists. With the default value of true, attachments matching blacklisted extensions or MIME types are rejected; setting it to false disables this blacklist-based validation. |
glide.attachment.blacklisted.extensions |
Not stated | e.g. exe,bat,cmd,com,msi,ps1,vbs,js,jar,scr | Lists file extensions blocked from being saved as attachments when attachment type blacklisting is enabled. For Studio Git operations, the list must not include txt or gitdata so required repository files can be saved. |
glide.attachment.blacklisted.types |
Not stated | e.g. application/x-msdownload,application/x-msdos-program | Lists MIME content types that ServiceNow blocks from being saved as attachments. When attachment-type blacklisting is enabled, excluding text/plain and application/octet-stream from the list supports Git operations that save required attachment data. |
glide.security.file.mime_type.validation |
true |
true | Enables MIME type validation for file attachments during upload. With the default value true, uploads are checked against their file content for extensions allowed by glide.attachment.extensions, helping block mismatched file types. |
glide.attachment.enable_secure_filename_validation |
Not stated | true | Enables strict attachment filename validation to block attempts to bypass MIME-type restrictions. The default is false; setting it to true can reject uploads with unsafe or unusual filename patterns. |
glide.attachment.enforce_security_validation |
Not stated | true | Enables MIME type and file extension validation for attachments uploaded through AttachmentCreator. When true, uploads are validated and use the correct file extension; false disables these checks and can allow dangerous files to be disguised. |
glide.security.file.mime_type.validation.inbound_email |
Not stated | true | Validates MIME types of attachments received through inbound email against their expected file formats. The default value is false, so validation is off until enabled; setting it to true checks inbound email attachments and helps prevent files whose content does not match the expected format. |
glide.security.mime_type.aliasset |
application/pkix-cert=text/plain,application/pkix-cert=application/x-dbf,applica… |
- | Defines MIME-type alias mappings used by file MIME-type validation. The default entries map application/pkix-cert to text/plain and application/x-dbf, and application/x-x509-ca-cert to text/plain during file validation. |
glide.attachment.trusted_system_extensions |
Empty | Leave as delivered | Allows listed file extensions for backend system-generated attachments even when standard extension validation rejects them. The default list is empty, so no extra extensions are exempt; additions must be non-executable and require security team approval. |
Limit attachment size
com.glide.attachment.max_size is the platform wide upload limit in megabytes. The delivered value is 1024, so files up to 1 GB are accepted. Most organizations go much lower, often between 25 and 100 MB.
Several features have their own, smaller limit on top. Catalog attachment variables default to 20 MB, guest uploads in chat to 10 MB, Visual Task Boards to 10 MB. The platform limit always applies as well, so a feature limit can only make things stricter in practice.
Email has separate limits in bytes, both for the total size and the number of attachments. Attachments over these limits are dropped, not rejected, so the email itself still arrives.
- Set
com.glide.attachment.max_sizeto the largest file a user really needs, in MB. - Check the feature limits below for the areas you use, and align them with the platform limit so users get a consistent answer.
- For a single catalog variable, set the
max_file_sizevariable attribute instead of changing the default for all variables. - Upload a file just over the new limit to confirm the error message users will see.
| Property | Default | Typical setting | What it does |
|---|---|---|---|
com.glide.attachment.max_size |
1024 |
e.g. 50 (MB) | Sets the maximum size, in megabytes, for file attachments. At the default of 1024 MB, uploads larger than 1 GB are rejected across supported attachment workflows. |
glide.sc.variable.attachment.default_max_size |
20 |
MB, at most the platform limit | Sets the default maximum file size, in megabytes, for Service Catalog attachment variables. At the default of 20 MB, uploads without a variable-specific limit are capped at 20 MB, subject to the platform-wide attachment limit. |
com.glide.cs.upload.attachment.max_size |
10 |
MB, guest uploads | Limits the maximum attachment upload size for guest users, with the value specified in megabytes. The default value of 10 sets a 10 MB limit, so larger files are checked before guest uploads can fail. |
vtb.board.upload_limit |
10 |
MB | Sets the maximum file size in megabytes for attachments on Visual Task Board cards. The default limit is 10 MB; raising or lowering it changes the largest file users can attach to a card. |
sn_hr_ef.max_file_size |
30 |
MB | Sets the maximum permitted employee document upload size in megabytes. The default limit is 30 MB; raising it allows larger files but can affect system performance. |
com.glide.attachment.max_get_size |
Not stated | - | Sets the maximum size of attachments that can be retrieved. The base value is 5 MB, so larger files require a higher limit for retrieval and supported workflows such as floor plan imports. |
glide.email.inbound.max_total_attachment_size_bytes |
18874368 |
bytes (18874368 = 18 MB) | Sets the maximum combined size of attachments processed from an inbound email. The default is 18,874,368 bytes; attachments beyond the configured limit are discarded, which can affect files available to inbound email processing. |
glide.email.outbound.max_total_attachment_size_bytes |
18874368 |
bytes, within your mail relay limit | Limits the combined size of attachments on each outbound email to a configured number of bytes. The default is 18,874,368 bytes; attachments that exceed the limit are ignored while the email is sent. |
glide.email.inbound.max_attachment_count |
30 |
- | Limits the number of attachments processed for each inbound email. The default limit is 30; attachments beyond the configured count are discarded, helping prevent performance degradation. |
glide.email.outbound.max_attachment_count |
30 |
- | Limits the number of attachments included in each outbound email. The default limit is 30; attachments beyond the configured maximum are ignored when the email is sent. |
Control downloads and previews
Opening an uploaded HTML or SVG file directly in the browser is a cross site scripting risk, because the file runs on your instance's domain. With glide.ui.attachment.force_download_all_mime_types on true (the default), every attachment downloads instead of rendering inline. glide.ui.attachment.download_mime_types lists the types that always download, even when that switch is off.
Previews are a separate topic. The workspace document viewer only previews the MIME types listed in sn_now_record_form.u_SupportedFileTypesForAttachmentPreview. The delivered list covers images, text, PDF and Office files, but no audio or video, so an mp3 shows no preview until you add audio/mpeg.
- Keep
glide.ui.attachment.force_download_all_mime_typesontrueunless you have a clear need for inline rendering. - If you switch it off, make sure
text/html,image/svg+xmlandapplication/xmlstay inglide.ui.attachment.download_mime_types. - To preview more types in workspaces, add their MIME types to the document viewer list, separated by commas.
- Use
glide.activity.attachment_previewto show only title and size in the activity stream instead of a preview.
| Property | Default | Typical setting | What it does |
|---|---|---|---|
glide.ui.attachment.force_download_all_mime_types |
true |
true | Forces every attachment MIME type to download instead of rendering inline in the browser. With the default value of true, the setting overrides the MIME-type list and prevents attachments from opening directly in the browser. |
glide.ui.attachment.download_mime_types |
text/html,image/svg,image/svg+xml,application/xml |
Keep the delivered types | Sets which attachment MIME types are downloaded instead of rendered inline in the browser. The default list covers HTML, SVG, and XML types, helping reduce cross-site scripting risk when all-MIME-type downloads are not enforced. |
glide.ui.attachment.admin_scs_download_mime_types |
Empty | e.g. text/html | Sets MIME types for admin-only uploads that must be downloaded instead of rendered inline. Listed types, such as text/html, are delivered as attachments through /scs/; the default list is empty. |
sn_now_record_form.u_SupportedFileTypesForAttachmentPreview |
image/jpeg, image/pjpeg, image/png, text/plain, application/pdf, application/vnd… |
Add e.g. audio/mpeg | Defines which file types the workspace document viewer can preview. By default, it includes common image, text, PDF, and Microsoft Office formats; changing the list changes which attachments can be previewed. |
glide.activity.attachment_preview |
true |
- | Displays attachment previews in the Activity Stream when enabled. With the default value of true, attachments appear as previews; setting it to false shows each attachment’s title and size instead. |
glide.ui.strict_customer_uploaded_static_content |
Not stated | true | Restricts which file types users can download after files are added through the Upload File functionality. When enabled, downloads are limited to types listed in glide.ui.strict_customer_uploaded_content_types; the property defaults to true and cannot be changed through a database override. |
glide.ui.strict_customer_uploaded_content_types |
ico,gif,png,jpg,jpeg,bmp,ogg,mp3 |
- | Lists file types that can be downloaded as static content when download restrictions are enabled. The default allowlist is ico, gif, png, jpg, jpeg, bmp, ogg, and mp3, limiting downloads to those formats. |
glide.ui.attachment_popup |
Not stated | - | Enables or hides the attachment [view] link. Setting the value to false hides the link, while true restores it so users can open attachments from within the browser. |
glide.ui.disable_attachment_view |
Not stated | - | Hides the attachment View link when set to true alongside the related popup setting. Users can still open attachments by selecting the file name, but not through the in-browser view link. |
Who can attach, and API access
glide.attachment.role lists the roles that may create attachments. The delivered value public lets every user attach files, including portal users. Narrowing it is a quick way to stop uploads from groups that never need them.
Attachments are also reachable through the REST Attachment API. Read access follows the ACLs of the parent record, but glide.rest.attachment_api.enforce_authentication makes sure requests without a session are rejected outright.
- Replace
publicinglide.attachment.rolewith the roles that need to attach, for exampleitil,snc_internal. Check portal and external users first. - Set
glide.rest.attachment_api.enforce_authenticationtotrueand test integrations that read or write attachments. - Turn on
glide.sg.block_mobile_attachments_sharingif attachments must not leave the mobile app.
| Property | Default | Typical setting | What it does |
|---|---|---|---|
glide.attachment.role |
public |
Roles that need it, e.g. itil,snc_internal | Limits attachment creation to users with roles listed in a comma-separated value. The default value, public, allows users with the public role to create attachments; leaving the value empty allows all roles to upload. |
glide.rest.attachment_api.enforce_authentication |
false |
true | Enforces authentication for requests to the REST Attachment API. With the default value of false, this enforcement is disabled; setting it to true requires API requests to authenticate. |
glide.rest.attachment_csm_api.allowed_tables |
Empty | - | Lists the tables whose associated attachments can be accessed through the CSM Attachment API. Requests for attachments on tables outside this comma-separated list are rejected as inaccessible; the supplied default is blank. |
glide.sg.block_mobile_attachments_sharing |
false |
- | Hides the attachment-sharing button in the ServiceNow mobile app when enabled. With the default value of false, users can use the button to download or share attachments. |
glide.ui.attachment_drag_and_drop |
true |
- | Enables users to add attachments by dragging files into supported HTML5 browsers. With the default value of true, drag-and-drop uploads are available; turning it off removes that attachment method. |
glide.import.file.extension_whitelist |
csv,xls,xlsx,json,xml,zip,txt |
Never add war | Restricts which file extensions DataSource.createAttachedDataSource() accepts using a case-insensitive allowlist. By default, CSV, Excel, JSON, XML, ZIP, and text files are allowed, while WAR files must not be allowed for security reasons. |
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.attachment.extensions',
'glide.security.attachment_type.use_blacklist',
'glide.attachment.blacklisted.extensions',
'glide.attachment.blacklisted.types',
'glide.security.file.mime_type.validation',
'glide.attachment.enable_secure_filename_validation',
'glide.attachment.enforce_security_validation',
'glide.security.file.mime_type.validation.inbound_email',
'glide.security.mime_type.aliasset',
'glide.attachment.trusted_system_extensions',
'com.glide.attachment.max_size',
'glide.sc.variable.attachment.default_max_size',
'com.glide.cs.upload.attachment.max_size',
'vtb.board.upload_limit',
'sn_hr_ef.max_file_size',
'com.glide.attachment.max_get_size',
'glide.email.inbound.max_total_attachment_size_bytes',
'glide.email.outbound.max_total_attachment_size_bytes',
'glide.email.inbound.max_attachment_count',
'glide.email.outbound.max_attachment_count',
'glide.ui.attachment.force_download_all_mime_types',
'glide.ui.attachment.download_mime_types',
'glide.ui.attachment.admin_scs_download_mime_types',
'sn_now_record_form.u_SupportedFileTypesForAttachmentPreview',
'glide.activity.attachment_preview',
'glide.ui.strict_customer_uploaded_static_content',
'glide.ui.strict_customer_uploaded_content_types',
'glide.ui.attachment_popup',
'glide.ui.disable_attachment_view',
'glide.attachment.role',
'glide.rest.attachment_api.enforce_authentication',
'glide.rest.attachment_csm_api.allowed_tables',
'glide.sg.block_mobile_attachments_sharing',
'glide.ui.attachment_drag_and_drop',
'glide.import.file.extension_whitelist'
];
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
How do I stop users from uploading .exe files in ServiceNow?
Either put the allowed extensions in glide.attachment.extensions, which rejects everything else, or keep glide.security.attachment_type.use_blacklist on true and add exe and other executable extensions to glide.attachment.blacklisted.extensions. Keep glide.security.file.mime_type.validation on true so a renamed .exe is caught by its content.
What is the maximum attachment size in ServiceNow?
The platform limit is set in com.glide.attachment.max_size, in megabytes. The delivered value is 1024 MB. Some features such as catalog attachment variables (20 MB) and guest chat uploads (10 MB) have their own smaller limits.
Why are attachments downloaded instead of opened in the browser?
glide.ui.attachment.force_download_all_mime_types is true by default, so every attachment downloads. This protects against scripts in uploaded HTML or SVG files. Types listed in glide.ui.attachment.download_mime_types always download.
Why does an mp3 not preview in a workspace?
The workspace document viewer only previews the MIME types in sn_now_record_form.u_SupportedFileTypesForAttachmentPreview. Audio is not in the delivered list; add audio/mpeg to preview mp3 files.
What does glide.attachment.extensions do when it is empty?
An empty value allows every extension. Only when you enter a list, without dots and separated by commas, are other extensions rejected in the attachment dialog.
Related
Something wrong or missing on this page? Tell me and I will fix it.
Send feedback