Permissions & Access Control
Media ships five granular ProcessWire RBAC permissions and enforces defense-in-depth across authenticated APIs, file uploads, storage paths, and public share galleries.
The Five RBAC Permissions
Section titled “The Five RBAC Permissions”| Permission | Scope | Capabilities Granted |
|---|---|---|
media-admin |
Full administration | Full access to Library, Trash, Crop Presets, Shares, Disks & Tools, Settings, and Private Vault metadata audit (vault-list / vault-sign). |
media-view |
Read-only browsing | Open Setup > Media, browse folders and collections, search, preview in Quick Look, and inspect asset metadata. |
media-upload |
Editorial authoring | Upload files, replace files in place, edit metadata/alt/tags/color labels, manage folders and collections, run Crop Studio, and import Stock Media or embeds. |
media-delete |
Lifecycle deletion | Move assets to Trash, restore trashed assets, and permanently delete assets or folders (subject to delete_policy). |
media-share |
External sharing | Create, view, revoke, and regenerate public shareable gallery links under Setup > Media > Shares. |
ProcessMedia::checkAccess() and canAccessSection() enforce these permissions per route so editors only see the sections they are authorized to use.
Upload, Path & Network Hardening
Section titled “Upload, Path & Network Hardening”- CSRF & Demo Mode (
$config->demo): Every mutating/_media/api/{action}request (all 37 actions inMediaApiGateway::MUTATING_ACTIONS) and every Setup > Media > Settings save validates ProcessWire$session->CSRFand rejects writes when$config->demoistrue. - File & Pixel-Bomb Caps:
UploadMetadataProcessorenforcesmax_upload_mb, extension +finfoMIME allowlists, ProcessWire$sanitizer->validateFile(), and a 64 MP pixel-bomb ceiling (16,384 pxmaximum axis). - Opt-In SVG Sanitization: SVG uploads are disabled by default (
allow_svg = 0). When enabled,Mediarejects<script>,DOCTYPE/ENTITYdeclarations, inline event handlers (onload,onclick), and unsafehrefschemes. - Chunked Upload & Revision Path Containment:
ChunkedUploadServicelocks each upload session’s public target disk, field, extension, and MIME atupload-init, rejects HTTP-supplied local paths (chunkPath/posterPath), and enforces$files->limitPath()plus symlink checks.AssetRepository::isSafeRevisionPath()verifies archived revisions remain strictly inside_revisions/{asset_id}/. - Type-Scoped
EntriesGuards:delete-folder,delete-preset, andsave-folderverify$entry->typematchesmedia_collectionsormedia_crop_presetsbefore mutating records. - SSRF Protection:
StockMediaServiceandEmbedServicevalidate HTTPS host allowlists and reject private or reserved DNS IP resolutions (FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE).