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

Yorkie API key is been leaking #435

Open
green-kong opened this issue Jan 22, 2025 · 3 comments
Open

Yorkie API key is been leaking #435

green-kong opened this issue Jan 22, 2025 · 3 comments
Labels
bug 🐞 Something isn't working

Comments

@green-kong
Copy link

What happened: Yorkie API key is been leaking in browser

What you expected to happen: Of course it shouldn't be..

How to reproduce it (as minimally and precisely as possible):
In browser development tool > source tab. you can find api key easily

Image

Anything else we need to know?:

Environment:

  • Operating system:
  • Browser and version:
  • CodePair version:
@green-kong green-kong added the bug 🐞 Something isn't working label Jan 22, 2025
@github-project-automation github-project-automation bot moved this to Backlog in CodePair Jan 22, 2025
@devleejb
Copy link
Member

Thank you for creating the issue!

The key in question is a public API key used on the frontend, so it should remain there. In contrast, our secret key for Yorkie is securely stored on the backend.
For fine-grained access control, Yorkie provides an authentication webhook.

@green-kong
Copy link
Author

green-kong commented Jan 23, 2025

Thank you for responding @devleejb

I misunderstood something.
I thought that public key is different by code pair user.
I didn't know Codepair uses single yorkie account.
I was worried about that public key is on my own.

But we are still on the problem.
Codepair can control role of document's participant.

Let's think about this case.
If I have an only read role on your document.
But as i said, I can get public key easily.

According to yorkie documents, I can make a yorkie client only with public key.
And getting document key is much easier.

Image

With these information, open up the vscode, write a few line of code...

Image

voilà! I just screwed up your document!

I know you can think I am going too much.
But as u know security can't have a limit lol.
I just wanted to let you know that it could be misused in this way, mate.

@devleejb
Copy link
Member

Yes, that’s correct.

Actually, this is a known issue. One way to address it is by enabling the Authentication Webhook. However, for various reasons, we haven’t enabled it yet. I believe now is the right time to consider enabling it. Thank you for bringing this up! I’ll discuss it with the other maintainers.

FYI, CodePair already supports authentication webhook endpoint: POST /check/yorkie

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
Status: Backlog
Development

No branches or pull requests

2 participants