<div dir="auto">It's an information disclosure vulnerability - if I happen to use a password that matches something in the script, then a diligent reader of the log file can discern my password.<div dir="auto"><br></div><div dir="auto">Of course, I shouldn't be using that weak a password. But people do. </div><div dir="auto"><br></div><div dir="auto">Peter</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, 3 Jul 2019, 13:43 Fabiano Fidêncio, <<a href="mailto:fidencio@redhat.com">fidencio@redhat.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Wed, Jul 3, 2019 at 1:54 PM Pavel Hrdina <<a href="mailto:phrdina@redhat.com" target="_blank" rel="noreferrer">phrdina@redhat.com</a>> wrote:<br>
><br>
> On Tue, Jul 02, 2019 at 09:21:45PM +0200, Fabiano Fidêncio wrote:<br>
> > Logging user & admin passwords in the command-line is a security issue,<br>
> > let's avoid doing so by:<br>
> > - Not printing the values set by the user when setting up the<br>
> > install-script config file;<br>
> > - Removing the values used in the install-scripts, when printing their<br>
> > content;<br>
> ><br>
> > 'CVE-2019-10183' has been assigned to the virt-install --unattended<br>
> > admin-password=xxx disclosure issue.<br>
> ><br>
> > Signed-off-by: Fabiano Fidêncio <<a href="mailto:fidencio@redhat.com" target="_blank" rel="noreferrer">fidencio@redhat.com</a>><br>
> > ---<br>
> >  virtinst/install/unattended.py | 10 ++++++++--<br>
> >  1 file changed, 8 insertions(+), 2 deletions(-)<br>
> ><br>
> > diff --git a/virtinst/install/unattended.py b/virtinst/install/unattended.py<br>
> > index 4f311296..04758563 100644<br>
> > --- a/virtinst/install/unattended.py<br>
> > +++ b/virtinst/install/unattended.py<br>
> > @@ -97,8 +97,6 @@ def _make_installconfig(script, osobj, unattended_data, arch, hostname, url):<br>
> >      log.debug("InstallScriptConfig created with the following params:")<br>
> >      log.debug("username: %s", config.get_user_login())<br>
> >      log.debug("realname: %s", config.get_user_realname())<br>
> > -    log.debug("user password: %s", config.get_user_password())<br>
> > -    log.debug("admin password: %s", config.get_admin_password())<br>
> >      log.debug("target disk: %s", config.get_target_disk())<br>
> >      log.debug("hardware arch: %s", config.get_hardware_arch())<br>
> >      log.debug("hostname: %s", config.get_hostname())<br>
> > @@ -195,6 +193,14 @@ class OSInstallScript:<br>
> >          content = self.generate()<br>
> >          open(scriptpath, "w").write(content)<br>
> ><br>
> > +        user_password = self._config.get_user_password()<br>
> > +        if user_password:<br>
> > +            content = content.replace(user_password, "[SCRUBBED]")<br>
> > +<br>
> > +        admin_password = self._config.get_admin_password()<br>
> > +        if admin_password:<br>
> > +            content = content.replace(admin_password, "[SCRUBBED]")<br>
><br>
> There is a small issue with this approach, if you for testing purposes<br>
> or for any other reason use password that matches anything else in the<br>
> script file (kickstart for example) it will be replaced as well:<br>
><br>
> """"""<br>
> %post --erroronfail<br>
><br>
> useradd -G wheel phrdina # Add user<br>
> if [SCRUBBED] -z ''; then<br>
>     passwd -d phrdina # Make user account passwordless<br>
> else<br>
>     echo '' |passwd --stdin phrdina<br>
> fi<br>
><br>
> if [SCRUBBED] -z '[SCRUBBED]'; then<br>
>     passwd -d root # Make root account passwordless<br>
> else<br>
>     echo '[SCRUBBED]' |passwd --stdin root<br>
> fi<br>
> """""<br>
><br>
> Here I used as a password 'test' and you can see the test command was<br>
> replaced as well.  Probably not a big deal is it modifies only the log<br>
> output, not the actual file but I thought that I should at least point<br>
> to this corner case issue.  Do we care about it or not?<br>
<br>
I thought about that and I sincerely don't care much about that.<br>
Otherwise we'll have to learn exactly what to match in all the install<br>
scripts supported (as in, kickstarts, autoyast, jeos, ...).<br>
<br>
><br>
> Pavel<br>
<br>
_______________________________________________<br>
virt-tools-list mailing list<br>
<a href="mailto:virt-tools-list@redhat.com" target="_blank" rel="noreferrer">virt-tools-list@redhat.com</a><br>
<a href="https://www.redhat.com/mailman/listinfo/virt-tools-list" rel="noreferrer noreferrer" target="_blank">https://www.redhat.com/mailman/listinfo/virt-tools-list</a></blockquote></div>