Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 407335 - x11-libs/vte writes scrollback to /tmp
Summary: x11-libs/vte writes scrollback to /tmp
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Security
Classification: Unclassified
Component: Vulnerabilities (show other bugs)
Hardware: All Linux
: Normal minor (vote)
Assignee: Gentoo Security
URL: http://www.climagic.org/bugreports/li...
Whiteboard: A4 [noglsa]
Keywords:
Depends on:
Blocks:
 
Reported: 2012-03-07 22:20 UTC by Julian Ospald
Modified: 2016-07-19 03:20 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 Julian Ospald 2012-03-07 22:20:09 UTC
x11-libs/vte writes scrollback to /tmp which can be (on) a partition on a harddrive and enable someone to use for example "strings /dev/sd*" on that and retrieve scrollback history even if that data is not stored in plain files.

the issue is discussed here:
https://bugzilla.gnome.org/show_bug.cgi?id=664611
https://bugzilla.gnome.org/show_bug.cgi?id=631685
https://bugzilla.xfce.org/show_bug.cgi?id=8183

Unless someone uses unlimited scrollback I guess the desired behavior is to write those data to RAM by default. This can be controlled by the TMPDIR environment variable ofc, however the _default_ location for that should not be /tmp.

The attached patch from here ( https://bugzilla.gnome.org/attachment.cgi?id=206579 ) applies and works on 0.28.2 successfully and keeps scrollback history in RAM when /dev/shm is available. Mind that the TMPDIR variable does not work anymore after this patch.
I did not test this on other versions yet.
Comment 1 Sean Amoss (RETIRED) gentoo-dev Security 2012-03-11 22:22:35 UTC
Thank you for the report. 

I don't think using /dev/shm is the best option, but we will monitor the upstream bugs to see how they respond.
Comment 2 Julian Ospald 2013-10-06 16:33:32 UTC
this is still unfixed

there is another patch here:

https://bug664611.bugzilla-attachments.gnome.org/attachment.cgi?id=209285
Comment 3 Chris Reffett (RETIRED) gentoo-dev Security 2013-10-06 18:11:38 UTC
I don't use vte so I can't test. If GNOME team hasn't responded in this long, I'd suggest that you call maintaner timeout and apply whichever patch you think is best.
Comment 4 Julian Ospald 2013-10-06 18:16:06 UTC
I haven't tested the second one and this would only fix slot :0.

From what I read from the reporter it seems that Konsole is affected as well.

I am not really sure how to proceed.
Comment 5 Pacho Ramos gentoo-dev 2013-10-06 21:35:12 UTC
Reading the long discussion in upstream bugs, I am not convinced to apply that patch, as looks like upstream developers have strong disagreement about how to solve this :|
Comment 6 Julian Ospald 2013-10-07 15:55:51 UTC
(In reply to Pacho Ramos from comment #5)
> Reading the long discussion in upstream bugs, I am not convinced to apply
> that patch, as looks like upstream developers have strong disagreement about
> how to solve this :|

It rather seems they don't really care about it.
Comment 7 Julian Ospald 2014-02-18 17:49:32 UTC
so what to do?
Comment 8 Pacho Ramos gentoo-dev 2014-02-18 20:44:54 UTC
I would do the same as Debian, opensuse and fedora: nothing until upstream doesn't move :/
Comment 9 Julian Ospald 2014-02-19 01:23:32 UTC
(In reply to Pacho Ramos from comment #8)
> I would do the same as Debian, opensuse and fedora: nothing until upstream
> doesn't move :/

i don't see how that is a good idea
Comment 10 Julian Ospald 2014-07-04 19:48:07 UTC
can we get a vote on what to do here?
Comment 11 Mart Raudsepp gentoo-dev 2016-01-12 09:27:15 UTC
x11-libs/vte:2.91, which is the backend terminal library used by gnome-terminal, has been crypting this content for a while now via gnutls (since end of 2014 at least, so since the March/April 2015 stable release at the very least). But on Gentoo only when USE=crypt is enabled on vte (it is IUSE=+crypt), because some users desire to disable this encryption. The security conscious do it when their /tmp is tmpfs or encrypted and swap is encrypted, so it'd be extra work without clear benefits. The security unconcious are able to shoot security in the foot with disabling that USE flag, but hey, that's what they asked then.
The temp files are created without being visible on the filesystem, but I'm sure that doesn't stop them being visible in the swap, but at least with vte[crypt], it should be encrypted via some algorithm I don't want to look up right now.
Comment 12 Aaron Bauman (RETIRED) gentoo-dev 2016-07-19 03:20:35 UTC
This looks like more hardening than a security bug.  However, upstream did fix the users request in a later release as mentioned by leio in the previous comment.


https://bugzilla.gnome.org/show_bug.cgi?id=664611

"The scrollback files' contents are encrypted now (using AES 256 GCM), will be released in vte-0.39.2.  So marking this bug as fixed."

So if any users are concerned with this, and did not take their own hardening measures, then they will receive it as 0.40.x is already stable in tree.