From 89c873e4aa707eece647815ccb4c423298dcb098 Mon Sep 17 00:00:00 2001 From: matt335672 <30179339+matt335672@users.noreply.github.com> Date: Fri, 9 Dec 2022 11:55:31 +0000 Subject: [PATCH] Set permissions on pcsc socket dir to owner only There is no reason for any user other than the current one to be able to communicate with the remote smartcard. --- sesman/chansrv/smartcard_pcsc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sesman/chansrv/smartcard_pcsc.c b/sesman/chansrv/smartcard_pcsc.c index b529da2e..edfcea87 100644 --- a/sesman/chansrv/smartcard_pcsc.c +++ b/sesman/chansrv/smartcard_pcsc.c @@ -1874,7 +1874,9 @@ scard_pcsc_init(void) } } } - g_chmod_hex(g_pcsclite_ipc_dir, 0x1777); + /* Only the current user should be able to access the remote + * smartcard */ + g_chmod_hex(g_pcsclite_ipc_dir, 0x700); g_snprintf(g_pcsclite_ipc_file, 255, "%s/pcscd.comm", g_pcsclite_ipc_dir); g_lis->trans_conn_in = my_pcsc_trans_conn_in; error = trans_listen(g_lis, g_pcsclite_ipc_file);