Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow POSTing image #383

Open
tgulacsi opened this issue Aug 12, 2023 · 3 comments
Open

Allow POSTing image #383

tgulacsi opened this issue Aug 12, 2023 · 3 comments

Comments

@tgulacsi
Copy link

Sorry for my incompetence, but why is POSTing explicitly forbidden?
For me it'd be way easier to POST the image to be transformed.

@cshum
Copy link
Owner

cshum commented Aug 16, 2023

imagor is designed for transforming images on public endpoints. POST method can raise significant security concerns, making it unsuitable for public requests.

However, it's worth noting that the POST method may be appropriate between private microservices.
This could be a feature considered for implementation, though it should be made opt-in through configuration. And the security implications must be effectively managed.

@tgulacsi
Copy link
Author

You mean that the URL of the image to be transformed is filtered according to the configuration,
and POSTing would allow any image to be transformed?

So, either opt-in in configuration as "unsafe-POST", or require the same HASH method for POST-ing:
allow POSTing to base-url/HASH only, and check that HASH is the same as the uploaded file's hash ?

@cshum
Copy link
Owner

cshum commented Aug 16, 2023

The POST endpoint may looks like this:

POST http://localhost:8000/unsafe/fit-in/200x200/filters:fill(white)

Where image key is empty.
But security hash requires image key to be in place.
So opt-in for POST means only unsafe option available. This is also to align with the expectation that POST is insecure.
It also means bypassing Storage & Result Storage, given image key is non-existent.

All in all POST requires a pretty big change to the current architecture.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants