| View previous topic :: View next topic |
| Author |
Message |
bigbangnet Apprentice


Joined: 11 Jun 2007 Posts: 174
|
Posted: Thu Mar 08, 2012 8:40 pm Post subject: Terminal flaw - reported by Mark Krenz @ www.climagic.org |
|
|
Go read the article please, it reports a flaw in terminal that allows a user to view your scrollback buffer that ends up on your /tmp filesystem over time including data passed back through an SSH connection
It was also reported on slashdot.org.
What do you guys think ? Any input would be appreciated. _________________ I'm a noob, be gentle with me. TEACH ME |
|
| Back to top |
|
 |
NeddySeagoon Administrator


Joined: 05 Jul 2003 Posts: 30123 Location: 56N 3W
|
Posted: Thu Mar 08, 2012 8:47 pm Post subject: |
|
|
bigbangnet,
You still have /tmp on disk ?
Its not safe with /tmp on shmfs either, but at least thats not sold on or scrapped with the disk. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
| Back to top |
|
 |
aCOSwt Advocate


Joined: 19 Oct 2007 Posts: 2075 Location: Between the keyboard and the chair
|
Posted: Thu Mar 08, 2012 8:56 pm Post subject: |
|
|
| NeddySeagoon wrote: | | You still have /tmp on disk ? |
hrrmm... what's wrong with that ?  _________________ In theory there are no differences between theory and practice. In practice, there are.
Don't try to understand my posts. Immanuel Kant never did, he thinks that only music and laughter do not have to mean anything. |
|
| Back to top |
|
 |
bigbangnet Apprentice


Joined: 11 Jun 2007 Posts: 174
|
Posted: Thu Mar 08, 2012 9:07 pm Post subject: |
|
|
Well, I'm at work right now so I can't check right now. But I followed that handbook instructions and I don't remember changing anything related to /tmpfs or the like. _________________ I'm a noob, be gentle with me. TEACH ME |
|
| Back to top |
|
 |
bigbangnet Apprentice


Joined: 11 Jun 2007 Posts: 174
|
Posted: Thu Mar 08, 2012 9:12 pm Post subject: |
|
|
| aCOSwt wrote: | | NeddySeagoon wrote: | | You still have /tmp on disk ? |
hrrmm... what's wrong with that ?  |
If you read the article, it states that anyone can look in your "backbuffer" of a terminal... a log of what you typed there in other words. _________________ I'm a noob, be gentle with me. TEACH ME |
|
| Back to top |
|
 |
Etal Veteran


Joined: 15 Jul 2005 Posts: 1634
|
Posted: Thu Mar 08, 2012 9:24 pm Post subject: |
|
|
| bigbangnet wrote: | | aCOSwt wrote: | | NeddySeagoon wrote: | | You still have /tmp on disk ? |
hrrmm... what's wrong with that ?  |
If you read the article, it states that anyone can look in your "backbuffer" of a terminal... a log of what you typed there in other words. |
... "anyone" as in anyone who has root or physical access to your machine? _________________ “And even in authoritarian countries, information networks are helping people discover new facts and making governments more accountable.”– Hillary Clinton, Jan. 21, 2010 |
|
| Back to top |
|
 |
NeddySeagoon Administrator


Joined: 05 Jul 2003 Posts: 30123 Location: 56N 3W
|
Posted: Thu Mar 08, 2012 9:37 pm Post subject: |
|
|
bigbangnet,
If you followed the handbook, /tmp is a subdir on /
/tmp is cleared on boot. The means the files are disgarded, the data they used to contain is stil on your HDD in the unallocated space.
With modern systems, a small /tmp is RAM is more than adequate, as long as you don't put DVD images there before you burn them. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
| Back to top |
|
 |
aCOSwt Advocate


Joined: 19 Oct 2007 Posts: 2075 Location: Between the keyboard and the chair
|
Posted: Thu Mar 08, 2012 9:46 pm Post subject: |
|
|
| bigbangnet wrote: | | If you read the article |
Yes I did and when I read | Quote: | | ...I think a very strong warning should be placed next to the scrollback buffer setting in the terminal emulator explaining that data will end up on disk. |
I am just left voiceless !
When I began under Unix (a MC68010 + 1M RAM + a VT100) a time when vi was holding its temporary files in /tmp, it was an evidence for everybody that whatever was keyed on the console could, at some point, be written on disk, would it be in an image of the stack of some process, getty included, in the swap area.
Of course, nobody ever asked why we were keeping the swap area on disk...  _________________ In theory there are no differences between theory and practice. In practice, there are.
Don't try to understand my posts. Immanuel Kant never did, he thinks that only music and laughter do not have to mean anything.
Last edited by aCOSwt on Thu Mar 08, 2012 9:54 pm; edited 1 time in total |
|
| Back to top |
|
 |
NeddySeagoon Administrator


Joined: 05 Jul 2003 Posts: 30123 Location: 56N 3W
|
Posted: Thu Mar 08, 2012 9:54 pm Post subject: |
|
|
aCOSwt,
:) _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
| Back to top |
|
 |
bigbangnet Apprentice


Joined: 11 Jun 2007 Posts: 174
|
Posted: Fri Mar 09, 2012 2:54 pm Post subject: |
|
|
| NeddySeagoon wrote: | bigbangnet,
If you followed the handbook, /tmp is a subdir on /
/tmp is cleared on boot. The means the files are disgarded, the data they used to contain is stil on your HDD in the unallocated space.
With modern systems, a small /tmp is RAM is more than adequate, as long as you don't put DVD images there before you burn them. |
Since I'm not home testing this I can't tell you the exact effect but from the way it's described and with what you tell me, yes /tmp is cleared on boot but as long as you don't reboot or turn off your machine and don't do anything to the partitions related to /tmp, people can get that data as the data is written on the disk.
Here is what you can guys do to test it, this is a quote from that site:
| Quote: | On Linux, if you want to see this behavior, you can do the following:
1. Open one of the affected terminal emulators.
2. Make sure its scrollback buffer is set to something like 500 or
more so that it saves some of the scrollback.
3. In the terminal, run:
ls -l /proc/$PPID/fd | grep deleted
If enough data has entered the scrollback buffer, you should start
to see unlinked (deleted) files called /tmp/vte.*
To see the data that has been logged to /tmp, you use a command like
strings to view the contents of your /tmp partition. If you have a
seperate /tmp partition and its located on /dev/sda2, this could be done
like this:
strings /dev/sda2 | less
You should be able to search within that data for bits of information
like your username on remote machines or the remote hostname you
connected to and find data that was sent to the terminal from those
remote systems, which could include sensitive information like passwords,
logs, etc. |
_________________ I'm a noob, be gentle with me. TEACH ME |
|
| Back to top |
|
 |
bigbangnet Apprentice


Joined: 11 Jun 2007 Posts: 174
|
Posted: Fri Mar 09, 2012 2:55 pm Post subject: |
|
|
| aCOSwt wrote: | | bigbangnet wrote: | | If you read the article |
Yes I did and when I read | Quote: | | ...I think a very strong warning should be placed next to the scrollback buffer setting in the terminal emulator explaining that data will end up on disk. |
I am just left voiceless !
When I began under Unix (a MC68010 + 1M RAM + a VT100) a time when vi was holding its temporary files in /tmp, it was an evidence for everybody that whatever was keyed on the console could, at some point, be written on disk, would it be in an image of the stack of some process, getty included, in the swap area.
Of course, nobody ever asked why we were keeping the swap area on disk...  |
not everyone knows linux inside out... Hell i had a tought or an idea that it would keep some data on disk but i didn't know anyone could access it that easily. _________________ I'm a noob, be gentle with me. TEACH ME |
|
| Back to top |
|
 |
PaulBredbury Watchman


Joined: 14 Jul 2005 Posts: 7043
|
Posted: Fri Mar 09, 2012 4:09 pm Post subject: |
|
|
| bigbangnet wrote: | | strings /dev/sda2 |
OMG panic
Only root can do that. |
|
| Back to top |
|
 |
wcg Guru

Joined: 06 Jan 2009 Posts: 569
|
Posted: Sat Mar 10, 2012 4:56 pm Post subject: |
|
|
Things that only root can do seem to me a waste of time to worry
about. root could log everything you type at the keyboard if root
wanted to. root can also log the contents of every network
packet that leaves or enters the machine. If a rogue process is
running as root, you are probably screwed and need to erase
your filesystems and restore from backup.
A more likely threat would be some rogue process running
as you that you inadvertently downloaded as a web plugin
or that was hatched by some web or email or multimedia embedded
script that is exploiting a weakness in your browser, email client,
or jukebox to scrounge around in your home directory, in /var/log/,
in any directories in /tmp/ owned by you, and so on.
(When was the last time you actually used a terminal's scrollback
buffer, anyway? Do you really need this enabled? You could set the
size to 0.) _________________ TIA |
|
| Back to top |
|
 |
suso Tux's lil' helper


Joined: 08 Apr 2004 Posts: 137 Location: Bloomington, IN
|
Posted: Wed Mar 21, 2012 2:35 pm Post subject: |
|
|
Hi. I'm Mark Krenz, the reporter of the flaw. I'm also a Gentoo user.
What many people seem to be missing on this is that once the scrollback buffer data is written to disk, even if the file gets deleted, the data is still there on the disk until that part of the disk is overwritten. Indeed, Gentoo's install handbook does not say anything about using tmpfs and its only mentioned on the hardened selinux instructions, which are buried pretty deep in the list of docs on the Gentoo site. So anyone who says "you should have been using tmpfs" should consider that most people probably aren't reading the advanced docs or getting this information.
Many people seemed to have missed the "memo" about using tmpfs on your Linux system. It was on display in the local planning office for the last nine months.
In the past week I've gone through and tested the default installs of 30 distributions of Linux as well as the FreeBSD, NetBSD and OpenBSD and only the most recent Arch Linux uses tmpfs for /tmp by default. In fact, none of them offer tmpfs as an option during partitioning. A few of them offer to clean /tmp, which ends up putting /tmp on tmpfs, but its turned off by default and only available if you go into advanced options.
I think there is a reason that many distributions do not default to having /tmp on tmpfs even though its been possible for many years. If you do so, then you affect the ability to recover from crashes in certain programs that use it for storing their running data. For example Audacity uses /tmp/audacity-user by default for temporary data. So forcing people to use tmpfs is not an ideal solution unless we move this change upstream to the many programs that have been expecting /tmp to be a physical filesystem for years. This is why I think the solution for this must be to change the libvte code so that it doesn't use the disk like this.
Also, the part about people needing root access to run strings is meaningless as well. If someone else gets a hold of your disk, then they can access the data there. If you sell your computer without wiping the disk, they can get access to the data there. You can't account for all the ways in which people use and dispose of their computers, so this report needs to reach as many people as possible so that they are aware of the problem and can deal with it accordingly if they need to.
So to make a long story short. This problem is significant for everybody in some way. Please take it seriously. _________________ Use saferdomainsearch.com to safely search for domain availability. |
|
| Back to top |
|
 |
PaulBredbury Watchman


Joined: 14 Jul 2005 Posts: 7043
|
Posted: Wed Mar 21, 2012 3:07 pm Post subject: |
|
|
| suso wrote: | | If someone else gets a hold of your disk, then they can access the data there. |
Oh come on. That's not a point *for* your argument, it's a point *against* your argument that this flaw is hugely important.
I nearly mentioned it at the time, but it's so basic that security people will already know it.
The files in /home are going to be far more important than /tmp, when they fall into the wrong hands.
Yeah, this is a bug. Congrats on your 15 mins of fame. So it goes on a bugzilla. Meanwhile, we upgrade e.g. openssl
| Quote: | OpenSSL 0.9.8u is now available, including important bug and security fixes.
OpenSSL 1.0.0h is now available, including important bug and security fixes. |
|
|
| Back to top |
|
 |
suso Tux's lil' helper


Joined: 08 Apr 2004 Posts: 137 Location: Bloomington, IN
|
Posted: Wed Mar 21, 2012 3:53 pm Post subject: |
|
|
I'm sorry you don't understand. I'll try to make it clear. The short of it is that not everyone uses computers the way we do. Here are a few examples in which the situation could get very bad for someone:
*Example A: A consultant who does sysadmin work goes to a variety of companies with their laptop and uses SSH to access systems and see sensitive data on those systems with normal commands like cat, grep, etc. The consultant and the companies think that everything is ok because the consulant is using SSH, doesn't have their swap turned on and the consultant doesn't deliberately save any data in their terminal or from the remote server. So no data from the servers that the consultant accessed should be on the constant's laptop. Since the consultant is convinced of this as well, they don't worry about encrypting their laptop, etc. and then the laptop gets stolen, lost or sold. The person who gets the laptop now has access to lots of data at multiple companies simply by reading the drive and searching for things like "username@remotehost".
*Example B: A company sets up "pseudo dumb terminal" computers for a group of people to access a text based script through SSH on a server where they add their medical information in order to renew their insurance for this year. Since the company assumes that since no data was stored on the actual terminals, they don't bother with wiping the drives on those computers that they are using like dumb terminals. Now medical information for several people are on drives that are not managed.
*Example C: A user level exploit comes out that allows someone to use someone else's browser to read the contents of files in /proc/*/fd, which includes the contents of the user's scrollback buffers that haven't been closed.
This isn't the typical kind of security issue where it gets patched upstream and people upgrade in the next release and are no longer vulnerable. Users need to know about this because part of the fix is to clean up the data that has already leaked onto their drives over the past 3 years. _________________ Use saferdomainsearch.com to safely search for domain availability. |
|
| Back to top |
|
 |
PaulBredbury Watchman


Joined: 14 Jul 2005 Posts: 7043
|
Posted: Wed Mar 21, 2012 4:48 pm Post subject: |
|
|
| suso wrote: | | don't worry about encrypting their laptop, etc. and then the laptop gets stolen, lost or sold. |
In England, the consultant would have a problem with the Data Protection Registrar, for not protecting sensitive data. And he would of course be being stupid.
| Quote: | | they don't bother with wiping the drives |
That's negligent. Never worth taking the risk.
| Quote: | | to read the contents of files in /proc/*/fd, which includes the contents of the user's scrollback buffers that haven't been closed. |
So a kernel bug. I'm more concerned with the sort of kernel bugs that give root access.
| Quote: | | leaked onto their drives over the past 3 years. |
In /tmp files, which aren't normally backed up, and which are deleted at startup or shutdown, if not on tmpfs?
This is not such a big issue. There are lots of other, more serious, security bugs in Linux, going on all the time. |
|
| Back to top |
|
 |
suso Tux's lil' helper


Joined: 08 Apr 2004 Posts: 137 Location: Bloomington, IN
|
Posted: Wed Mar 21, 2012 4:59 pm Post subject: |
|
|
Well good for the queen then. I'm glad she has such diligent people under her wing. _________________ Use saferdomainsearch.com to safely search for domain availability. |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|