-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
libgit2 credentials objects are dangerous #23232
Comments
See JuliaLang/julia#23231 and JuliaLang/julia#23232 Also update Deprecations for a minor bug.
Perhaps a better approach would be to have a |
Yes, that seems like a good approach. It might have other safety properties, like not being so easily copied around or converted to a normal string, to avoid inadvertent copies leaking into memory. |
is there prior art for this in other languages? seems like something that should be fairly common |
See also the discussion in #17560, where a One objection to Another objection is that it's not clear to me what My preference would be to just change |
Another perspective is that the problem @Keno identified may be a feature, not a bug: you shouldn't be putting sensitive password/credential data into program string literals, should you? |
The username may or may not be a sensitive credential. In any case zeroing out semantically immutable memory is a bad idea. |
In any case, changing it to |
I created a PR which implements |
When they finalize themselves, they zero their contents. In particular, they also zero the underlying memory of any string they contains, so for example, in the following:
after the first such object is finalized, that literal gets zero'd and subsequent calls to the same function are constructed with a zero string. I suggest that instead, we pass
Vector{UInt8}
s to these objects, which are semantically mutable and people won't be as surprised to see them zerod.The text was updated successfully, but these errors were encountered: