rpi-imager icon indicating copy to clipboard operation
rpi-imager copied to clipboard

[BUG] Insecure permissions for configuration file holding hashed password & plaintext WiFi password

Open ricardobranco777 opened this issue 1 year ago • 3 comments

Describe the bug

The configuration file which holds the hashed & plaintext WiFi has insecure permissions by default.

To Reproduce

on Linux:

$ ls -l "$HOME/.config/Raspberry Pi/Imager.conf"
-rw-rw-r--. 1 ricardo ricardo 775 Nov 19 12:13 Imager.conf
$ grep Password "$HOME/.config/Raspberry Pi/Imager.conf"
sshUserPassword=$5$xxx
wifiPassword=xxx

Expected behaviour

0600 permissions.

ricardobranco777 avatar Dec 30 '23 13:12 ricardobranco777

Thanks for the report, @ricardobranco777.

I can confirm I see the same, and will address this in a patch later this week.

tdewey-rpi avatar Jan 02 '24 15:01 tdewey-rpi

Was under the impression that if we just re-used the passwords that were set in the imager that they would be correct - but they are not working for SSH.

So if I re-use a password for another Pi it is wrong as it has been hashed.

However the WiFi password remains correct???

audas avatar Mar 02 '24 23:03 audas

Was under the impression that if we just re-used the passwords that were set in the imager that they would be correct - but they are not working for SSH.

So if I re-use a password for another Pi it is wrong as it has been hashed.

However the WiFi password remains correct???

@audas This sounds like a different problem, but also one that I would expect to be true, as I don't know if SSH uses the same hashing scheme as WPA-PSK. Please raise unique issues for unique problems.

tdewey-rpi avatar Mar 04 '24 09:03 tdewey-rpi