I love breaking things and I've noticed that user are able to intercept the UID / ID of the received messages in the Websocket and edit / spoof past messages from other users.
edit: And editing other user names and rooms settings.
Thanks for catching that! One thing I really wanted for the project was not having to sign in to use, but that's been causing a lot of security holes like this. Gonna try to fix everything soon
Out of curiosity, what are the motivation(s) for not requiring users to sign in? Is it just lowering the barrier to entry, or are you concerned with privacy?
I'm really not knowledgeable about firestore, firebase or even authentification systems but couldn't an user request a secret key that the user will use to authentificate itself when sending a message into the websocket (that will not be transmitted to the other users)?
For the login-gate, I'm pretty sure 99%+ of the visitor would have not created an account. Even without the login, the HN room shared in that thread was kind of inactive.
Since the rooms are "private' by default (secret token in the URL), authentification is now really necessary for casual usage.
Yes you could generate a rsa key pair in the browser and send a tuple of user id (or just a nonce) and public key to the server as a form of automatic registration. The client could prefix each chat with the user if/nonce and sign it with the private key before sending it to the server. From then on the server could simply retrieve the public key it has associated with the user id prefix and reject any messages that fail signature validation.
This could also work in a peer-to-peer context by only using the server for public key registration (i.e. by chat room). All messages would go directly between clients and the server would never receive chat messages.
I tried my hand at something similar using a sleep music themed YT channel and website. Couldn't get things to click. And FB ended up blocking my site on the sharing debugger.
I think there's a line where it stops being reasonable. If I know every comment on a Show HN is going to be blatant self promotion, I'm not going to view those posts even if the OP is interesting to me.
> Show HN is for something you've made that other people can play with. HN users can try it out, give you feedback, and ask questions in the thread.
> On topic: things people can run on their computers or hold in their hands. For hardware, you can post a video or detailed article. For books, a sample chapter is ok.
I am glad to see work from other hacker news members. When it isn't interesting to me, I find something else on the internet or IRL that is.
Great point. While not everything is appropriate to share in response to someone else's "Show HN" post, I've definitely seen (and appreciated) others linking similar projects. It usually is in the context of saying something like:
- I tried this too, and can appreciate that you solved way harder things than we expected to have to deal with
- I had this idea too but like your execution
I think it's very fitting, especially since we are celebrating not just the idea, but the execution that someone did to be able to show it off here.
Maybe there should be a weekly/monthly “Show HN” (like the who’s hiring thread) where everyone can promote what they’re working on. Doesn’t have to be new things, even progressive updates would do.
Hey @dang, how does a free-for-all self promotion thread sound (minus the spam)
https://lofi.chat/r/Hacker-news-310e9120
Good vibes only