mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2026-03-01 04:28:51 +00:00
Improve password handling #978
Labels
No labels
I1
I2
I3
I4
S1
S2
S3
S4
U0
U1
U2
U3
U3
U4
blocked
bug
bug
cli
compiler
config
config
consensus
dependencies
discussion
documentation
enhancement
epic
feature
go
good first issue
help wanted
neotest
network
oracle
performance
question
rpc
security
smartcontract
task
task
task
test
vm
wallet
windows
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
nspcc-dev/neo-go#978
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @roman-khimov on GitHub (Sep 1, 2022).
In many cases we get passwords from configuration files and they're all strings somewhere in memory, this can't really be improved. But we also get passwords from the CLI in most of regular commands and they can be cleaned after use, except our
input.ReadPasswordreturns astringthat can't be changed. We can do someBut it's not enough, we then have an
(*Account).Decryptthat also wants astring,keys.NEP2Decryptthat accepts strings (and converts them immediately to[]byte), so we have a huge set of changes before long. And then we have external code like neofs-node or neofs-http-gw that happily calls(*Account).Decryptwith a string and would be surprised (hi, @fyrchik, @alexvanin) if it to be changed to accept[]byte.The question mostly is, are we paranoid enough to do this at all?
@alexvanin commented on GitHub (Sep 8, 2022):
External code of NeoFS services also reads passwords from config in many cases.
Personally, I won't be upset with
s/passwd/[]byte(passwd)/gif it reduces security risks.@roman-khimov commented on GitHub (Sep 8, 2022):
It's not that it's the end of world problem, but removing sensitive data from memory when it's no longer needed is a (very) good practice.
@AnnaShaleva commented on GitHub (Jan 26, 2023):
The https://github.com/nspcc-dev/neo-go/pull/2887#discussion_r1086394998 should also be fixed within the scope of this issue.