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

Users can save any URL as favicon image via the API #31

Open
clarkwinkelmann opened this issue Jun 13, 2022 · 0 comments
Open

Users can save any URL as favicon image via the API #31

clarkwinkelmann opened this issue Jun 13, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@clarkwinkelmann
Copy link
Member

Bug Report

Current Behavior
By tampering with the REST API requests, users can save any favicon URL in the database, and it doesn't even have to be a DuckDuckGo favicon URL.

It's also possible to save a favicon URL even when the admin setting for favicons is disabled.

Expected Behavior
Ideally, the DuckDuckGo URL should entirely be computed server-side, and the frontend should just send whether it wants to use the favicon service or not. Not storing the URL in the database would be even better as it would allow switching the favicon service without updating every user record.

But as a compromise to simplify the fix, the validator could also just validate the URL matches the DuckDuckGo favicon endpoint, and optionally that the hostname matches. I don't see how you could abuse changing just the hostname in the favicon URL, because if you want to fake a favicon appearance you can already link to a domain you own with the favicon of your choice.

Environment

  • Flarum version: 1.3.1
  • Extension version: dev-master as of 2022-06-13

Possible solution(s)
As described in expected behavior.

The simple solution can probably be done with a regular expression in the validator instead of allowing any value for favicon. But the regexp needs to change depending on the value of the favicon setting in the admin.

@clarkwinkelmann clarkwinkelmann added the bug Something isn't working label Jun 13, 2022
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

1 participant