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

not secure, current implementation passes username from frontend #17

Closed
aaayushsingh opened this issue Oct 25, 2018 · 1 comment
Closed

Comments

@aaayushsingh
Copy link

anyone user can send a message with any alias

$(".chat-message button").on("click", function(e) {
        var textareaEle = $("textarea[name='message']");
        var messageContent = textareaEle.val().trim();
        if (messageContent !== "") {
          var message = {
            content: messageContent,
            username: username,
            date: Date.now()
          };

          socket.emit("newMessage", roomId, message);
          textareaEle.val("");
          app.helpers.addMessage(message);
        }
      });

any user can thus pass any username

@OmarElgabry
Copy link
Owner

Absolutely. I didn't mention Its meant to be secured.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants