oss-sec mailing list archives

Re: Healing the bash fork


From: Michal Zalewski <lcamtuf () coredump cx>
Date: Tue, 30 Sep 2014 17:04:31 -0700

I don't know if this can be made efficient enought to be practical, but
imagine a virtual machine where every byte of memory is tagged with the
security domain.  When a byte is copied, the tag is copied also.  (It is not
possible in general to distinguish copies from writes, but at least when
copying between domains via system calls, this is detectable.) Then, when a
privileged program is running, its memory can be scanned for data from a
lower privilege domain.

You're describing taint tracking, which is actually a pretty hard
problem when you realize that data isn't an abstract, immutable
entity, but rather something that is used as input for arithmetics,
conditional branches, etc (is a byte set as a result of a tainted
conditional also tainted? for far-reaching should this effect be?).

But more fundamentally, in your example, what does it prove? In
practical settings, privileged programs will routinely have data from
lower (or at least other) privilege levels in memory, but that doesn't
indicate a security problem. In particular, both the fixed and the
vulnerable versions of bash will have that property when invoked via a servlet.

/mz


Current thread: