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

Web app: validate server URLs #204

Closed
cmeis opened this issue Apr 8, 2022 · 6 comments
Closed

Web app: validate server URLs #204

cmeis opened this issue Apr 8, 2022 · 6 comments
Labels
🪲 bug Something isn't working web-app Web app things

Comments

@cmeis
Copy link
Contributor

cmeis commented Apr 8, 2022

As in issue #193 for the Android app, the web app doesn't do any validation on the server url for user accounts (apart from it having to be at least one character long ;-) ). See screenshot:
Screenshot 2022-04-08 235839
Needs proper input validation for the URL.

@binwiederhier
Copy link
Owner

Indeed. 😱

Good catch.

@binwiederhier
Copy link
Owner

There isn't really much validation I can do apart from just checking that it starts with https?:// -- If I was gonna get fancy, I could make an endpoint to check that the server is a valid ntfy server, but that's not really worth it, so I think I'll stick with the http/s-chekc

@binwiederhier binwiederhier added 🪲 bug Something isn't working web-app Web app things labels Apr 8, 2022
@cmeis
Copy link
Contributor Author

cmeis commented Apr 9, 2022 via email

@binwiederhier
Copy link
Owner

is-valid-hostname reminded me of the left-pad debacle. I generally try to keep dependencies out as much as possible (though that's hard to do in the JS world). But hostname checking doesn't have to be that strict. If it's wrong, stuff will not work and you'll fix it. :-D

I think I'm alright with just checking for http://..

@cmeis
Copy link
Contributor Author

cmeis commented Apr 9, 2022

Tell me about dependency hell..... I'm fine with fixing my own sh*t 😉

@binwiederhier
Copy link
Owner

This is done and will be in the next release. Just basic URL validation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🪲 bug Something isn't working web-app Web app things
Projects
None yet
Development

No branches or pull requests

2 participants