ifcfg,keyfile: fix temporary file races (CVE-2016-0764)
authorLubomir Rintel <lkundrak@v3.sk>
Fri, 29 Jan 2016 09:27:10 +0000 (10:27 +0100)
committerLubomir Rintel <lkundrak@v3.sk>
Fri, 29 Jan 2016 19:18:28 +0000 (20:18 +0100)
commit60b7ed3bdc3941a3b7c56824fba4b7291e79041f
tree55828c826487465033990e17438387b8b8250e77
parent503b714f15dd7c9369ed13dfb324739a386ceb03
ifcfg,keyfile: fix temporary file races (CVE-2016-0764)

Two of these raised Coverity's eyebrows.

CID 59389 (#1 of 1): Insecure temporary file (SECURE_TEMP)
5.  secure_temp: Calling mkstemp without securely setting umask first.

CID 59388 (#1 of 1): Insecure temporary file (SECURE_TEMP)
1.  secure_temp: Calling mkstemp without securely setting umask first.

Last one raised mine.

When a connection is edited and saved, there's a small window during which and
unprivileged authenticated local user can read out connection secrets (e.g. a
VPN or Wi-Fi password). The security impact is perhaps of low severity as
there's no way to force another user to save their connection.
src/settings/plugins/ifcfg-rh/writer.c
src/settings/plugins/keyfile/writer.c