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

store serialized JWT token in []byte instead in the JWT-SVID #177

Open
Dentrax opened this issue Dec 15, 2021 · 1 comment
Open

store serialized JWT token in []byte instead in the JWT-SVID #177

Dentrax opened this issue Dec 15, 2021 · 1 comment

Comments

@Dentrax
Copy link

Dentrax commented Dec 15, 2021

Just noticed token field uses string data type. From the security perspective, shouldn't it be stored in []byte instead?

Since the string is immutable, once we've created it, if another process can dump memory like ollydbg, etc., there's no way you can get rid of the data before garbage collection kicks in. 1

What are your thoughts?

Footnotes

  1. https://security.stackexchange.com/a/172578/188106

@azdagron
Copy link
Member

azdagron commented Jan 3, 2022

While I agree in principal, I'm curious how to make this practical. How do you see callers effectively clearing the backing array of that slice? What shape of the library could we impose to encourage (or better yet, force) them to clear it? Even though we control this particular struct, we don't control others (e.g. the grpc internal buffers used to receive the message from the workload API), in which case are we really mitigating anything by making this change since other copies will surely exist?

To be clear, I'm not opposed to changing it to []byte, and would happy to accept a PR in that direction, I just don't think it's going to have any practical effect on the security posture of the workload. Thoughts??

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