Skip to content

How to avoid image-resize attacks from side requests ? #330

Open
@Awilum

Description

@Awilum

Hello!

I am using Glide in my Images service to manipulate images from side resources via Rest API https://flextype.org/documentation/rest-api/images
like it is https://imgix.com.

I see this example here https://glide.thephpleague.com/2.0/simple-example/

<img src="/img/users/<?=$user->id?>.jpg?w=300&h=400&fit=crop">

and it is fine to build urls in this way,

but then I read this: https://glide.thephpleague.com/2.0/config/security/
it's saying that it is not secure and we should use signatures and build URLs with help of UrlBuilderFactory.

GET /api/images/{path:.+}?VALID_ARGUMENTS&token=YOUR_IMAGES_TOKEN

I know know my YOUR_IMAGES_TOKEN but image signature is unique per each request.

And even on the current server I can't create request to the API by typing url with arguments, because it requires signature for security reason.

on https://imgix.com example, I don't see signatures (or I am wrong), how do they protect server from image-resize attacks ? any ideas ?

Is there some simple way to make secure requests without UrlBuilderFactory?
Is it possible to get signatures out of the server somehow in simple way?
Or maybe there is any other ways to protect server from image-resize attacks ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions