Upload and image-processing boundaries
triangle/media · AGPL-3.0-or-later
The package declares ext-imagick and includes Triangle\Media\Uploader, ImageProcessing, RateLimiter, URI dispatch and plugin controllers. Uploader takes a project ID; uploadFile($data) and uploadLink($url) are the source entry points. ImageProcessing exposes cropImage, resizeImage, pixelizeImage, addCover and getImageBlob. These signatures do not prove every controller route is safe or publicly supported.
The uploader currently reads plugin.framex.media.app.image_uri, while controller/install files use another plugin/media layout. Reconcile effective configuration and storage paths before use. A writable directory check does not validate file contents or access rights.
For uploads, enforce authenticated project ownership, extension/MIME/content checks, size/pixel/CPU limits, random storage keys and non-executable storage. Remote-URL import additionally needs an SSRF policy: permit selected protocols, resolve and reject private/link-local/loopback targets, recheck redirects and bound response size/time. Do not pass arbitrary user URLs directly to uploadLink. Run image conversion with constrained resources and review the installed ImageMagick policy.
No production upload/SSRF test has been performed here. Retain original filenames only as escaped display metadata, never trusted filesystem paths. Define deletion/retention and signed download access before exposing private media.
Direct dependencies
Section titled “Direct dependencies”| Package | Constraint |
|---|---|
php | ^8.1 |
triangle/engine | ^8.1 |
ext-imagick | * |
Pinned source · 3423e5c35432.