Skip to main content

Disallow Lists

Disallow lists let you restrict which image formats and transforms PreviewProxy will accept. This reduces attack surface by preventing processing of formats or operations that your application does not need.

tip

Use disallow lists to limit attack surface. For example, if you only serve WebP output, block all other output formats so that no other format can be requested.

INPUT_DISALLOW_LIST

Blocks requests where the source image is of a specific format.

INPUT_DISALLOW_LIST=pdf,psd,video

Accepted tokens:

TokenBlocks
jpegJPEG source images
pngPNG source images
gifGIF source images
webpWebP source images
avifAVIF source images
jxlJPEG XL source images
bmpBMP source images
tiffTIFF source images
pdfPDF source documents
psdPhotoshop PSD files
videoVideo file inputs

OUTPUT_DISALLOW_LIST

Blocks requests that ask for a specific output format via the format parameter.

OUTPUT_DISALLOW_LIST=bmp,tiff,ico

Accepted tokens:

TokenBlocks
jpegJPEG output
pngPNG output
gifGIF output
webpWebP output
avifAVIF output
jxlJPEG XL output
bmpBMP output
tiffTIFF output
icoICO output

TRANSFORM_DISALLOW_LIST

Blocks requests that use specific transform operations.

TRANSFORM_DISALLOW_LIST=watermark,gif_anim

Accepted tokens:

TokenBlocks
resizeWidth/height resize
rotateImage rotation
flipHorizontal/vertical flip
grayscaleGrayscale conversion
brightnessBrightness adjustment
contrastContrast adjustment
blurBlur filter
watermarkWatermark overlay
gif_animAnimated GIF processing

Behavior

  • Multiple tokens are comma-separated with no spaces
  • Unknown tokens are silently ignored (a warning is logged)
  • Requests that use a disallowed format or transform receive an error response