GNU bug report logs - #37196
27.0.50; auth-source no longer obfuscates passwords

Previous Next

Package: emacs;

Reported by: Lars Ingebrigtsen <larsi <at> gnus.org>

Date: Tue, 27 Aug 2019 10:30:02 UTC

Severity: normal

Tags: fixed, security

Found in version 27.0.50

Fixed in version 27.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 37196 in the body.
You can then email your comments to 37196 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#37196; Package emacs. (Tue, 27 Aug 2019 10:30:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Lars Ingebrigtsen <larsi <at> gnus.org>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Tue, 27 Aug 2019 10:30:03 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: bug-gnu-emacs <at> gnu.org
Subject: 27.0.50; auth-source no longer obfuscates passwords
Date: Tue, 27 Aug 2019 12:29:43 +0200
Emacs got a better pretty printer for compiled code sometime over the
last few years, and that means that the obfuscator that auth-source uses
no longer works.  (It puts the password into a closure.)

With the following in ~/.authinfo

machine foo.bar login zot password foobar

we get

(auth-source-search :max 1 :host "foo.bar")
=> ((:host "foo.bar" :user "zot" :secret #[0 "<binary>" [("foobar") (nil)] 3]))

with the "foobar" clearly printed out.  This should be fixed by
obfuscating the password in a different way.

Similarly, the printed representation of auth-source-netrc-cache also
has the password in clear text now.



In GNU Emacs 27.0.50 (build 27, x86_64-pc-linux-gnu, GTK+ Version 3.22.11)
 of 2019-08-23 built on marnie
Repository revision: b4065de33cf397b80e15c22740d34b4a03cfdc17
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.11902000
System Description: Debian GNU/Linux 9 (stretch)


-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





Added tag(s) security. Request was from Stefan Kangas <stefan <at> marxist.se> to control <at> debbugs.gnu.org. (Tue, 27 Aug 2019 11:33:01 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#37196; Package emacs. (Fri, 20 Sep 2019 20:06:02 GMT) Full text and rfc822 format available.

Message #10 received at 37196 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: 37196 <at> debbugs.gnu.org
Subject: Re: bug#37196: 27.0.50; auth-source no longer obfuscates passwords
Date: Fri, 20 Sep 2019 22:05:34 +0200
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> Emacs got a better pretty printer for compiled code sometime over the
> last few years, and that means that the obfuscator that auth-source uses
> no longer works.  (It puts the password into a closure.)
>
> With the following in ~/.authinfo
>
> machine foo.bar login zot password foobar
>
> we get
>
> (auth-source-search :max 1 :host "foo.bar")
> => ((:host "foo.bar" :user "zot" :secret #[0 "<binary>" [("foobar") (nil)] 3]))
>
> with the "foobar" clearly printed out.  This should be fixed by
> obfuscating the password in a different way.

I have now done this --

(auth-source-search :max 1 :host "foo.bar")
=> ((:host "foo.bar" :user "zot" :secret #[0 "..." [(103 112 112 99 98 115) (nil) apply string mapcar 1-] 6]))

It's not exactly super-secret, but I think that's as far as we can get
here.  I briefly considered having a per-session nonce stored in memory,
and then using an encryption primitive to obfuscate the data (that would
mean that anybody mistakenly mailing these around wouldn't be able to
root out the password without having access to the running Emacs
instance).

Hm.  Now that I typed that, it strikes me that this should be rather
trivial to do with gnutls-symmetric-encrypt on systems where that is
available.  I'll give it a go...

> Similarly, the printed representation of auth-source-netrc-cache also
> has the password in clear text now.

This was already OK.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#37196; Package emacs. (Fri, 20 Sep 2019 20:14:01 GMT) Full text and rfc822 format available.

Message #13 received at 37196 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: 37196 <at> debbugs.gnu.org
Subject: Re: bug#37196: 27.0.50; auth-source no longer obfuscates passwords
Date: Fri, 20 Sep 2019 22:13:11 +0200
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> Hm.  Now that I typed that, it strikes me that this should be rather
> trivial to do with gnutls-symmetric-encrypt on systems where that is
> available.  I'll give it a go...

Fortunately I remembered that I had already written all this symmetric
encryption stuff in a separate project, so I just cut and paste a bit.

(I mean, the encryption primitives are already in Emacs, but actually
using them requires a bit of typing...)

(auth-source-search :max 1 :host "foo.bar")
=> ((:host "foo.bar" :user "zot" :secret #[0 "..." ["Ng==-26GRPWrYlJnQAE+8gaEDcg==-DThpcRwaAi5ZBXQZC0rC3g==" (nil) auth-source--deobfuscate] 3]))

There.  That's better.  It does leak that the password is 6 characters
long, though, but that's a lot less leaky than ... it was before.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Added tag(s) fixed. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Fri, 20 Sep 2019 20:14:02 GMT) Full text and rfc822 format available.

bug marked as fixed in version 27.1, send any further explanations to 37196 <at> debbugs.gnu.org and Lars Ingebrigtsen <larsi <at> gnus.org> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Fri, 20 Sep 2019 20:14:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 19 Oct 2019 11:24:11 GMT) Full text and rfc822 format available.

This bug report was last modified 4 years and 162 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.