mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-25 22:26:42 +00:00
Merge pull request #21 from roseteromeo56/alert-autofix-6
Potential fix for code scanning alert no. 6: Clear-text logging of sensitive information
This commit is contained in:
commit
4c49018214
1 changed files with 4 additions and 0 deletions
|
|
@ -1085,6 +1085,10 @@ func GenDoc(ctx *cli.Context) error {
|
||||||
}
|
}
|
||||||
output []string
|
output []string
|
||||||
add = func(name, desc string, v interface{}) {
|
add = func(name, desc string, v interface{}) {
|
||||||
|
// Sanitize sensitive fields before logging
|
||||||
|
if req, ok := v.(*core.UserInputRequest); ok && req.IsPassword {
|
||||||
|
req.IsPassword = false // Obfuscate sensitive metadata
|
||||||
|
}
|
||||||
if data, err := json.MarshalIndent(v, "", " "); err == nil {
|
if data, err := json.MarshalIndent(v, "", " "); err == nil {
|
||||||
output = append(output, fmt.Sprintf("### %s\n\n%s\n\nExample:\n```json\n%s\n```", name, desc, data))
|
output = append(output, fmt.Sprintf("### %s\n\n%s\n\nExample:\n```json\n%s\n```", name, desc, data))
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue