3 ms·
We did something similar when we were running our own home grown publishing system, though it was only for sizing purposes (no fund stuff like discount badges).
by mrkurt 17y ago
We did something similar when we were running our own home grown publishing system, though it was only for sizing purposes (no fund stuff like discount badges).
If you go this route, be very careful making the URLs too human readable. When it's obvious that you can hammer on URLs to use server resources, it becomes a natural vector for a denial of service. If we went this route again, I'd go one step further than encrypting sensitive data, and encrypt anything that can somehow result in a new image.
Unfortunately, doing this safely sorta kills the user friendliness of it. It was fantastic to be able to tell authors "if you want a 100x100 image, add /100w/100h/ before the file name". I think they'd be less inclined to respond to "if you want a 100x100 image, generate a hash from the width x height x secret key and add /100w/100h/the-hash/ before the image".
- jacquesm 17y agoWe included a simple list of permitted sizes to protect against that. The velocity controls will block out a bot in a heartbeat anyway, but it seemed like a good thing to have.