semantic-kernel icon indicating copy to clipboard operation
semantic-kernel copied to clipboard

copilot-chat ChatHistory controller neither authenticates nor validates message ownership

Open IanNorris opened this issue 1 year ago • 5 comments

Describe the bug The ChatHistory endpoint is unauthenticated and it is possible to interact with the backend API without any kind of authentication.

It is also possible to query and access chat messages for other users.

To Reproduce Steps to reproduce the behavior:

  1. Access https://localhost:40443/chatSession/getAllChats/<AAD object ID>.<Tenant ID>
  2. This will list all conversations for any user you know the object ID of

Expected behavior The ChatHistory controller is missing an [Authorize] attribute, and the endpoints should validate that the user requesting the messages owns or has access to them.

IanNorris avatar May 05 '23 17:05 IanNorris

Nice call out, lol, but I think there are several notes that indicate not to use this for production and since the sample app is meant to convey the novelty behind using SK for the copilot use case, I probably wouldn't expect the sample app to articulate further with assumptions on a security implementation.

That's my take, I'm a consumer just like you.

cchighman avatar May 05 '23 22:05 cchighman

As the team is open to PR, I think it would be a great addition if you could make it work.

dedalo avatar May 07 '23 11:05 dedalo

@IanNorris @dedalo Happy to contribute a PR to this.

parthvnp avatar May 09 '23 02:05 parthvnp

@parthvnp - Yes, we are open to PRs and would be great if you can contribute.

hathind-ms avatar May 16 '23 18:05 hathind-ms

@hathind-ms Thanks. I will start working on a fix.

parthvnp avatar May 18 '23 00:05 parthvnp

This has been fixed with https://github.com/microsoft/chat-copilot/pull/126

gitri-ms avatar Aug 21 '23 16:08 gitri-ms