Skip to main content

Overview

ButterCMS media assets are served through a global CDN with built-in security features. This guide covers how image URLs work, access control, and best practices for protecting your media.

URL security model

Random CDN slugs

Each media file in ButterCMS is assigned a unique, random slug that serves as its identifier:
Security Properties:
  • Slugs are randomly generated by Filestack during upload
  • They are not sequential or predictable
  • Knowledge of one URL does not reveal others

Public CDN access

By default, all media on the ButterCMS CDN is publicly accessible:
  • No authentication required to access images
  • Images can be embedded anywhere (websites, emails, apps)
  • Search engines can index images if linked publicly
This model follows the same security pattern as other headless CMS platforms—media URLs are designed to be publicly embeddable.

Access control strategies

Keep URLs private

If you need to control who sees your images:
  1. Server-side rendering: Fetch images server-side and serve through your authenticated endpoints
  2. Proxy through your app: Create authenticated routes that proxy CDN requests
  3. Short-lived URLs: Generate URLs only when needed, don’t store them long-term

Proxy implementation

Signed URLs pattern

Signed URLs are not a built-in ButterCMS feature. The following is an example pattern you can implement in your own backend to control access through a proxy.
Generate time-limited, signed URLs for sensitive content:

HTTPS enforcement

All ButterCMS CDN URLs use HTTPS:
Benefits:
  • Encrypted data transmission
  • Protection against man-in-the-middle attacks
  • Required for modern security headers (HSTS, CSP)

Content security policy

Configure your CSP headers to allow ButterCMS images:

With inline styles (for background images)

Next.js configuration

Transformation security

Image transformations don’t require additional authentication:
Considerations:
  • Anyone with the file ID can apply any transformation
  • Transformations are cached at the CDN edge
  • No additional cost for transformations

Rate limiting transformations

If you’re concerned about transformation abuse:
  1. Proxy transformations: Route through your server with rate limiting
  2. Cache aggressively: Use CDN caching for transformed images
  3. Monitor usage: Track transformation requests in your analytics
To prevent other sites from embedding your images:

Server-side referrer checking

Nginx configuration

Best practices

Don't Expose File IDs

Avoid exposing CDN file IDs in client-side code for sensitive content.

Use HTTPS Always

Ensure all image references use HTTPS URLs.

Implement CSP

Configure Content Security Policy headers for your domain.

Monitor Access

Track image access patterns for unusual activity.

API token security

Your ButterCMS API tokens (Read/Write) are separate from image access:
Never expose your Write API Token in client-side code. It can be used to modify or delete content.

Sensitive content guidelines

For truly sensitive media:
  1. Don’t upload to ButterCMS: Use a dedicated secure storage solution
  2. Encrypt before upload: Encrypt files client-side if you must store them
  3. Access control: Implement server-side access control with signed URLs
  4. Audit logging: Track all access to sensitive media

Next steps

Image Transformations

Transform images via URL

Responsive Images

Optimize for devices

Authentication

API authentication

Media Library

Managing media