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

SSRF vulnerability #94

Closed
fluix-dev opened this issue Apr 19, 2021 · 2 comments
Closed

SSRF vulnerability #94

fluix-dev opened this issue Apr 19, 2021 · 2 comments
Labels
bug Something isn't working

Comments

@fluix-dev
Copy link
Collaborator

Reporting in the public because this got added 1 hour ago and I don't believe this site is deployed publicly.

I'm pretty sure #93 adds an SSRF vulnerability in the addUnsplashPicture handler here:

url = request.POST["url"]
url += ".jpg"
response = requests.get(url, stream=True)

The url that gets requested here is attacker controlled, with the exception of a forced .jpg being added on meaning they could request local content from 127.0.0.1 for example. I'm not actually sure where this view is used, but mitigations could be either only passing along the image ID (like photo-1547656807-9733c2b738c2) which gets appended to https://images.unsplash.com/ or check that the domain is Unsplash. You should also probably use allow_redirects=False to prevent any open redirects leading to SSRFs.

@fluix-dev fluix-dev added the bug Something isn't working label Apr 19, 2021
@fluix-dev
Copy link
Collaborator Author

@Gongsta bump on this because the website appears to be live.

@Gongsta
Copy link
Member

Gongsta commented May 8, 2021

Fixed in commit. Thanks!

@Gongsta Gongsta closed this as completed May 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants