Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 610840 - Hide root password set via passwd=... option from normal user
Summary: Hide root password set via passwd=... option from normal user
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Release Media
Classification: Unclassified
Component: LiveCD/DVD/USB (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Release Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-02-24 21:11 UTC by Alexander Bezrukov
Modified: 2017-02-25 00:59 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Bezrukov 2017-02-24 21:11:53 UTC
Gentoo Handbook documents use of passwd kernel command line option which sets root password at some point in boot process when booted off official Gentoo installation media. This is useful together with dosshd option which starts sshd and thus allows for remote installation. The bad thing about this is that any user can read /proc/cmdline and learn root password, which may be  not secure. By "any user" I mean also an attacker possibly gained normal user access because of some vulnerable application such as web-browser, which is especially important because some released media (Gentoo LiveDVD) are updated not so often. A simple grep -w passwd /proc/cmdline >/dev/null && chmod 400 /proc/cmdline (after the point when both /proc and /dev/null are available, of course) would mitigate the issue. I don't believe that applications running as unprivileged users would ever need read /proc/cmdline and the human user booted install media (or LiveDVD) can always gain root access anyway.
Comment 1 Alexander Bezrukov 2017-02-24 21:17:53 UTC
And if for whatever reason it is not possible to fix the issue, then I believe documentation should be updated to warn about possibility to read root password from /proc/cmdline when it is passed through passwd=... option.
Comment 2 Rick Farina (Zero_Chaos) gentoo-dev 2017-02-24 21:45:05 UTC
In my opinion, this is a documentation issue not a technical issue.  In any place we instruct a user to set passwd= we should also instruct them to hidpid=1

It's not our job to clean up after every potential mistake people can make.
Comment 3 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2017-02-25 00:54:53 UTC
(In reply to Rick Farina (Zero_Chaos) from comment #2)
> In my opinion, this is a documentation issue not a technical issue.  In any
> place we instruct a user to set passwd= we should also instruct them to
> hidpid=1
hidepid=[12] only protects /proc/$PID/cmdline. It does NOT protect /proc/cmdline.
Comment 4 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2017-02-25 00:59:16 UTC
livecd-tools:
[master 35e6ad4] autoconfig: protect password in /proc/cmdline.
 Date: Fri Feb 24 16:46:45 2017 -0800
 1 file changed, 1 insertion(+)


Released as 2.3 in the tree, releng just needs to bump the catalyst inputs to use it.