#930530 pcscd: Runs with possibly unnecessary privileges

Package:
pcscd
Source:
pcsc-lite
Description:
Middleware to access a smart card using PC/SC (daemon side)
Submitter:
Kevin Locke
Date:
2025-11-01 15:25:03 UTC
Severity:
normal
Tags:
#930530#5
Date:
2019-06-14 16:02:30 UTC
From:
To:
Dear Maintainer,

pcscd currently runs as root.  This is a security risk (as pointed out
in the SECURITY file shipped with pcscd).  It was previously fixed in
Bug #606142 and regressed back to root when systemd support was added
(setgid was removed in 798d03c).

Is there a reason that pcscd needs to run as root, rather than a normal
user with access to the necessary device files?  If so, could the
rationale be documented in the SECURITY file?  If not, what would be
required to run as a non-root user and would you accept patches that
make the necessary changes?

Thanks,
Kevin

#930530#10
Date:
2019-06-14 19:43:29 UTC
From:
To:
Le 14/06/2019 à 18:02, Kevin Locke a écrit :

Hello Kevin,

You are completely right.
It is a known task on my TODO list. See https://salsa.debian.org/rousseau/PCSC/issues/10

I know systemd has many features that could help.
Please provide patches upstream (it is not a problem limited to Debian).

You can use https://salsa.debian.org/rousseau/PCSC or https://github.com/LudovicRousseau/PCSC to provide pull requests.

Maybe you should first discuss ideas and solutions on the pcsclite-muscle mailing list.
https://lists.infradead.org/mailman/listinfo/pcsclite-muscle

Bye

#930530#21
Date:
2025-03-26 15:42:46 UTC
From:
To:
Le 14/06/2019 à 21:43, Ludovic Rousseau a écrit :

The issue https://salsa.debian.org/rousseau/PCSC/issues/10 was about restricting pcscd accesses using systemd hardening.
This issue is fixed in the latest release 2.3.2. https://blog.apdu.fr/posts/2025/03/new-version-of-pcsc-lite-232/
But pcscd is still running as root.

The next step is to run pcscd as a normal user.
This change is on my todo list.

Bye, and thank you for your patience

#930530#26
Date:
2025-03-26 22:49:37 UTC
From:
To:
That's wonderful!  Those changes look great and 2.3.2-1 is working
well for me.  Thank you for working on it and for posting this update!

That'll be great.  I really appreciate the restrictive sandboxing in
the meantime.

Thanks again for your work on this!

#930530#31
Date:
2025-11-01 11:00:14 UTC
From:
To:
Le 26/03/2025 à 23:49, Kevin Locke a écrit :

pcscd from pcsc-lite 2.4.0-1 now runs as a normal user.

See also https://blog.apdu.fr/posts/2025/10/pcscd-runs-as-pcscd-user/

Closing this bug.
Sorry for the 6 years of delay.

Thanks

#930530#36
Date:
2025-11-01 15:22:22 UTC
From:
To:
That's fantastic!  No need to be sorry; I know it's easy to request
features and infinitely more work to implement them.  Thanks so much
for all of your effort implementing this.  It seems like a big security
gain and I'm looking forward to deploying it!

Thanks again,
Kevin