<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"><channel><title>Matasano Chargen - Latest Comments in What We&amp;#8217;ve Since Learned About Leopard Security Features</title><link>http://matasanochargen.disqus.com/</link><description></description><language>en</language><lastBuildDate>Mon, 03 Dec 2007 16:28:21 -0000</lastBuildDate><item><title>Re: What We&amp;#8217;ve Since Learned About Leopard Security Features</title><link>http://www.matasano.com/log/986/what-weve-since-learned-about-leopard-security-features/#comment-2323395</link><description>concerning the filtering of outgoing connections: there is a open source project at &lt;a href="http://sourceforge.net" rel="nofollow"&gt;sourceforge.net&lt;/a&gt; that aims at that problem (&lt;a href="http://sourceforge.net/projects/ppfilter" rel="nofollow"&gt;http://sourceforge.net/projects/ppfilter&lt;/a&gt;).</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">anonymous</dc:creator><pubDate>Mon, 03 Dec 2007 16:28:21 -0000</pubDate></item><item><title>Re: What We&amp;#8217;ve Since Learned About Leopard Security Features</title><link>http://www.matasano.com/log/986/what-weve-since-learned-about-leopard-security-features/#comment-2323394</link><description>I'm just curious on the firewall comment...what OS comes with a outbound firewall enabled by default? It seems more like something which was on your wishlist and which you only are mentioning because you're disappointed...It seems like there are plenty of other things you could put on that same wishlist and call out in this article :S</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">bobdole</dc:creator><pubDate>Fri, 16 Nov 2007 23:05:22 -0000</pubDate></item><item><title>Re: What We&amp;#8217;ve Since Learned About Leopard Security Features</title><link>http://www.matasano.com/log/986/what-weve-since-learned-about-leopard-security-features/#comment-2323393</link><description>The Parental Controls feature, or at least the portion of it that allows an admin user to create a Safe account under which only specific apps can be executed, has been in place since, i believe, Panther, but just never really touted.&lt;br&gt;&lt;br&gt;I'd briefly mentioned it here:&lt;br&gt;&lt;br&gt;&lt;a href="http://theappleblog.com/2005/02/15/best-from-apple-protecting-computer/" rel="nofollow"&gt;http://theappleblog.com/2005/02/15/best-from-ap...&lt;/a&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">chris holland</dc:creator><pubDate>Wed, 14 Nov 2007 02:46:30 -0000</pubDate></item><item><title>Re: What We&amp;#8217;ve Since Learned About Leopard Security Features</title><link>http://www.matasano.com/log/986/what-weve-since-learned-about-leopard-security-features/#comment-2323376</link><description>&amp;gt; First documented? Let me quote the systace(1) manual page itself:&lt;br&gt;&amp;gt; &lt;br&gt;&amp;gt; BUGS&lt;br&gt;&amp;gt; Applications that use clone()-like system calls to share the complete address&lt;br&gt;&amp;gt; space between processes may be able to replace system call arguments after&lt;br&gt;&amp;gt; they have been evaluated by systrace and escape policy enforcement.&lt;br&gt;&amp;gt; &lt;br&gt;&amp;gt; It says the same thing as Robert Watson’s paper. That comment was added to&lt;br&gt;&amp;gt; the manual page on July 21, 2002, by Niels Provos, the original author.&lt;br&gt;&lt;br&gt;Just to clarify history here slightly: the man page comment was added by Niels shortly after my private e-mail to him on July 19th, 2002 raising these issues and expressing my concern over the potential vulnerability of Systrace policies to such attacks.&lt;br&gt;&lt;br&gt;The point of the recent paper was to more thoroughly explore this class of vulnerabilities and previously undocumented exploit techniques (this being a workshop on exploiting vulnerabilities), not just in Systrace but in the general class of software wrappers used to enforce security policies. It turns out many anti-virus engines suffer from exactly the same class of problem, and many end users depend heavily on the reliability of anti-virus engines. It is very important that weaknesses in the approach, and especially the ease of exploiting the vulnerability, be understood by the more general software authoring community. Unlike OpenBSD users, these end-users will be significantly less sophisticated when it comes to avoiding downloading and running binaries from unreliable sources, and they don't have a firm OS foundation to protect them, hence running with anti-virus software in the first place.&lt;br&gt;&lt;br&gt;Robert Watson</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Robert Watson</dc:creator><pubDate>Wed, 07 Nov 2007 19:54:48 -0000</pubDate></item><item><title>Re: What We&amp;#8217;ve Since Learned About Leopard Security Features</title><link>http://www.matasano.com/log/986/what-weve-since-learned-about-leopard-security-features/#comment-2323375</link><description>It doesn't seem like the answer is "canonicalizing" the ioctl payload between userland and time-of-use. It seems to me like you can solve 95% of this problem by not letting untrusted code open sensitive devices or issue sensitive ioctl calls. &lt;br&gt;&lt;br&gt;There is certainly some trivial case of an ioctl that every program needs to issue that has an ambiguous interpretation. I am missing it. What is it?&lt;br&gt;&lt;br&gt;Great stuff, though. Thanks!</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Thomas Ptacek</dc:creator><pubDate>Sat, 03 Nov 2007 15:20:09 -0000</pubDate></item><item><title>Re: What We&amp;#8217;ve Since Learned About Leopard Security Features</title><link>http://www.matasano.com/log/986/what-weve-since-learned-about-leopard-security-features/#comment-2323392</link><description>A copyin buffer for the system call arguments is not nearly enough to solve this problem.  It requires nearly an entire rewrite of how the kernel handles system calls.&lt;br&gt;&lt;br&gt;ioctl(), fcntl(), bind(), connect() and and a host of other system calls have arguments which point to a buffer which contains the important stuff -- those buffers are still very much attackable.&lt;br&gt;&lt;br&gt;ioctl() actually is probably the hardest. In most BSD-derivatives the size is encoded in the 2nd argument, but the interpretation of the 3rd argument is not done until you hit deep driver code.&lt;br&gt;&lt;br&gt;A simple approach might be to "lock" the userland address space in such situations to provide atomicity, but that is very SMP hostile if not done perfectly.&lt;br&gt;&lt;br&gt;If the problem was simple it would have been solved a long time ago.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Theo de Raadt</dc:creator><pubDate>Sat, 03 Nov 2007 14:45:32 -0000</pubDate></item><item><title>Re: What We&amp;#8217;ve Since Learned About Leopard Security Features</title><link>http://www.matasano.com/log/986/what-weve-since-learned-about-leopard-security-features/#comment-2323391</link><description>Niels: it's coming! The good news is, like 4 different Matasano people have now had a hand in it. =)</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Thomas Ptacek</dc:creator><pubDate>Sat, 03 Nov 2007 13:25:15 -0000</pubDate></item><item><title>Re: What We&amp;#8217;ve Since Learned About Leopard Security Features</title><link>http://www.matasano.com/log/986/what-weve-since-learned-about-leopard-security-features/#comment-2323390</link><description>I am glad that Systrace is providing opportunity for such stimulating discussions.  As Theo stated, the problems that Robert described in his WOOT paper were all well known.  Robert's contribution was a concise summary of the various problems.&lt;br&gt;&lt;br&gt;However, the TOCTOU issues in Systrace and their solution were even mentioned in the Systrace paper.  The original implementation used a local-aside buffer for copyin.  As a result, the system call arguments were stored in kernel address space and could not be changed by any sandboxed process.&lt;br&gt;&lt;br&gt;Other issues like flipping symlinks were resolved in a similar way.  Once Systrace has canonicalized the path, the kernel is told that the path may not contain symlinks.&lt;br&gt;&lt;br&gt;If people are really interested in this topic, I recommend reading Tal Garfinkel's paper on the Ostia system (2003) which presents a similar list of problems as those presented by Robert.&lt;br&gt;&lt;br&gt;Thomas, I am still waiting on your "Virtual Honeypots" book review :-)</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Niels Provos</dc:creator><pubDate>Sat, 03 Nov 2007 11:46:45 -0000</pubDate></item><item><title>Re: What We&amp;#8217;ve Since Learned About Leopard Security Features</title><link>http://www.matasano.com/log/986/what-weve-since-learned-about-leopard-security-features/#comment-2323374</link><description>Start with these points:&lt;br&gt;&lt;br&gt;- All sorts of subtle little bugs that people don't really audit for will disclose either (a) actual offsets into the heap or (b) the secrets used to generate those offsets.&lt;br&gt;&lt;br&gt;- Inputs to programs can drastically influence the predictability of allocations even when they are randomized.&lt;br&gt;&lt;br&gt;- In a significant number of cases, you can get leverage control of a CPU register and any known large span of opcodes to land code where you need to.&lt;br&gt;&lt;br&gt;- When you start randomizing the heap, you wind up in a losing battle against performance (the biggest problem in allocator design is fragmentation). &lt;br&gt;&lt;br&gt;- Retries.&lt;br&gt;&lt;br&gt;I know the conventional wisdom is that, done right, ASLR is very effective. And I do less shellcoding than almost anyone else involved in this argument. But I'm not sold on ASLR, and I am sold on things like Sandboxes and Systrace.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Thomas Ptacek</dc:creator><pubDate>Fri, 02 Nov 2007 14:03:09 -0000</pubDate></item><item><title>Re: What We&amp;#8217;ve Since Learned About Leopard Security Features</title><link>http://www.matasano.com/log/986/what-weve-since-learned-about-leopard-security-features/#comment-2323389</link><description>"I could now waste your time with a discussion of how valuable stack and heap randomization is, but it’s a moot point: the OS X stack and heap don’t appear to be randomized."&lt;br&gt;&lt;br&gt;I'd be interested in a discussion of that value (or lack thereof).</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Hal B</dc:creator><pubDate>Fri, 02 Nov 2007 13:53:31 -0000</pubDate></item><item><title>Re: What We&amp;#8217;ve Since Learned About Leopard Security Features</title><link>http://www.matasano.com/log/986/what-weve-since-learned-about-leopard-security-features/#comment-2323388</link><description>The heap is NX when you compile 64-bit.&lt;br&gt;&lt;br&gt;Try compiling your test program with&lt;br&gt;gcc -arch x86_64 test.c&lt;br&gt;&lt;br&gt;This would require a 64-bit processor like the Core 2 Duo or whatever comes with the Mac Pro.&lt;br&gt;&lt;br&gt;&lt;br&gt;Also, the main executable(but not dyld) is randomized if you compile with -Wl,-pie.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Hal B</dc:creator><pubDate>Fri, 02 Nov 2007 13:49:37 -0000</pubDate></item><item><title>Re: What We&amp;#8217;ve Since Learned About Leopard Security Features</title><link>http://www.matasano.com/log/986/what-weve-since-learned-about-leopard-security-features/#comment-2323372</link><description>jf: yes, SSP support in the OSX 10.5 system gcc is confirmed. Have a look at the gcc-5465 source to see for yourself, especially gcc/ChangeLog.apple. It is not present on 10.4.x gcc (for which the src is available as well) nor is it present in the stock gcc 4.0.1.&lt;br&gt;&lt;br&gt;It does not look like Apple compiled anything with -fstack-protector. Reasons are unknown. For an actual implementation of the stack protector you have to look into libgcc-8.1 (which, funnily enough, is derived from gcc-4.2.0).</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Ralf (a.k.a someone else)</dc:creator><pubDate>Fri, 02 Nov 2007 12:55:30 -0000</pubDate></item><item><title>Re: What We&amp;#8217;ve Since Learned About Leopard Security Features</title><link>http://www.matasano.com/log/986/what-weve-since-learned-about-leopard-security-features/#comment-2323387</link><description>Hrm the SSP/ProPolice is confirmed? From what I saw they shipped with GCC 4.0.1, and SSP went into mainline in GCC 4.1?&lt;br&gt;&lt;br&gt;I'm guessing from what someone else commented here they attempted to put the protection in themselves, and screwed it up?</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">jf</dc:creator><pubDate>Fri, 02 Nov 2007 04:41:43 -0000</pubDate></item><item><title>Re: What We&amp;#8217;ve Since Learned About Leopard Security Features</title><link>http://www.matasano.com/log/986/what-weve-since-learned-about-leopard-security-features/#comment-2323386</link><description>I agree that the underlying class of vulnerabilities is ancient. I'm not standing by the number "7", just noting that when we vetted the paper for WOOT, it was noted that there was an old mailing list post behind it --- making it a bit weird as a new piece of research.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Thomas Ptacek</dc:creator><pubDate>Thu, 01 Nov 2007 19:53:09 -0000</pubDate></item><item><title>Re: What We&amp;#8217;ve Since Learned About Leopard Security Features</title><link>http://www.matasano.com/log/986/what-weve-since-learned-about-leopard-security-features/#comment-2323385</link><description>OK, you beat me.  7 years, by the way, is older than systrace(1) itself.... it being only 5 years ago.&lt;br&gt;&lt;br&gt;Unless you mean the generic TOCTOU problem.  Well, that was known about way more than 7 years ago and documented in piles of other academic papers.  It might be interesting to see how far back that goes.&lt;br&gt;&lt;br&gt;It is access(2) or stat(2) all over again.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Theo de Raadt</dc:creator><pubDate>Thu, 01 Nov 2007 19:47:55 -0000</pubDate></item><item><title>Re: What We&amp;#8217;ve Since Learned About Leopard Security Features</title><link>http://www.matasano.com/log/986/what-weve-since-learned-about-leopard-security-features/#comment-2323384</link><description>OK, you beat me.  7 years, by the way, is older than systrace(1) itself.... it being only 5 years ago.&lt;br&gt;&lt;br&gt;Unless you mean the generic TOCTOU problem.  Well, that was known about way more than 7 years ago and documented in piles of other academic papers.  It might be interesting to see how far back that goes.&lt;br&gt;&lt;br&gt;It is access(2) or stat(2) all over again.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Theo de Raadt</dc:creator><pubDate>Thu, 01 Nov 2007 19:47:31 -0000</pubDate></item><item><title>Re: What We&amp;#8217;ve Since Learned About Leopard Security Features</title><link>http://www.matasano.com/log/986/what-weve-since-learned-about-leopard-security-features/#comment-2323383</link><description>Ralf: I am guessing that you are right and I'm wrong. I think I may have been misinterpreting the offset call at the beginning of subroutines (a PIE artifact).</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Thomas Ptacek</dc:creator><pubDate>Thu, 01 Nov 2007 19:42:04 -0000</pubDate></item><item><title>Re: What We&amp;#8217;ve Since Learned About Leopard Security Features</title><link>http://www.matasano.com/log/986/what-weve-since-learned-about-leopard-security-features/#comment-2323381</link><description>... though do note, Theo, that Watson "documented" this in a mailing list post like 7 years ago.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Thomas Ptacek</dc:creator><pubDate>Thu, 01 Nov 2007 19:41:13 -0000</pubDate></item><item><title>Re: What We&amp;#8217;ve Since Learned About Leopard Security Features</title><link>http://www.matasano.com/log/986/what-weve-since-learned-about-leopard-security-features/#comment-2323382</link><description>On it's own stack protection is barely useful.&lt;br&gt;&lt;br&gt;But it is still very relevant when used with other things:&lt;br&gt;&lt;br&gt;  1) Best-effort ALSR, especially top-of-stack and (as you&lt;br&gt;     mention) the shlib linker.&lt;br&gt;  2) W^X on the _entire_ address space (the mprotect&lt;br&gt;     component of this is often overstated though as it&lt;br&gt;     only gets involved in the 2nd or 3rd step of an&lt;br&gt;     attack, and the combination of all these things&lt;br&gt;     makes lib-return very hard.&lt;br&gt;  3) A sprinking of resistance in libc such as&lt;br&gt;     malloc/free paranoia, dtor/atexit carefulness, etc.&lt;br&gt;  4) PIE, just because it affects the known values on your&lt;br&gt;     stack SO MUCH..&lt;br&gt;&lt;br&gt;If you mix all 4 of these things together with compiler assisted stack protect, it is a very difficult (hostile)&lt;br&gt;programming environment for an attacker.&lt;br&gt;&lt;br&gt;Those are the most effective schemes.  Other crazy schemes have gone through our heads in the years, such as malloc padding things to unmapped pages exactly, or non-readable code segments (on platforms that support it, but you need to fix the switch-table code in compilers...) but most fancy things start causing problems.  The amount of non-security third party bugs you start helping people fix gets unmanagable...</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Theo de Raadt</dc:creator><pubDate>Thu, 01 Nov 2007 19:41:07 -0000</pubDate></item><item><title>Re: What We&amp;#8217;ve Since Learned About Leopard Security Features</title><link>http://www.matasano.com/log/986/what-weve-since-learned-about-leopard-security-features/#comment-2323380</link><description>Dave: Actually, I think Apple screwed up big time with stack protection in Leopard. My testing so far is preliminary, so please take the following with one or possibly more grain(s) of salt.&lt;br&gt;&lt;br&gt;I've looked at XCode today. Long. I haven't been able to find a single option to enable stack protection, neither for a project, nor globally. Nothing in the help either. What's Apple's famed dev environment, the Visual Studio for OSX? XCode, I thought. &lt;br&gt;&lt;br&gt;Also, compiling my own C code with -fstack-protector (using the system gcc) yields binaries that have undefined references to __stack_chk_fail and __stack_chk_guard. I don't see these undef refs neither on Safari, iChat, Mail nor on CUPS.&lt;br&gt;&lt;br&gt;@Thomas: mDNSResponder doesn't have these either, which makes me doubt your earlier statement. What did you see that made you claim that it was in the first Leopard post?&lt;br&gt;&lt;br&gt;Actually, I have concers that even with stack protection enabled, due to the way dyld works, things may be working suboptimal. But that needs further research still.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Ralf</dc:creator><pubDate>Thu, 01 Nov 2007 19:40:10 -0000</pubDate></item><item><title>Re: What We&amp;#8217;ve Since Learned About Leopard Security Features</title><link>http://www.matasano.com/log/986/what-weve-since-learned-about-leopard-security-features/#comment-2323373</link><description>I agree with Theo.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Thomas Ptacek</dc:creator><pubDate>Thu, 01 Nov 2007 19:25:25 -0000</pubDate></item><item><title>Re: What We&amp;#8217;ve Since Learned About Leopard Security Features</title><link>http://www.matasano.com/log/986/what-weve-since-learned-about-leopard-security-features/#comment-2323379</link><description>I actually think stack protection is still relevent.  Particularly, the client-side attack surface of large applications like Safari, iChat and Mail.  Let alone the fact that there are enough third party developers that are not security conscious and developing for Mac OS X.  &lt;br&gt;&lt;br&gt;I also generally like improvements where compilers and operating systems protect me from potentially unsafe code.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Dave G.</dc:creator><pubDate>Thu, 01 Nov 2007 19:21:09 -0000</pubDate></item><item><title>Re: What We&amp;#8217;ve Since Learned About Leopard Security Features</title><link>http://www.matasano.com/log/986/what-weve-since-learned-about-leopard-security-features/#comment-2323378</link><description>Thomas, a quick correction: The code signatures are &lt;b&gt;not&lt;/b&gt; enforced by the TMSafetyNet kext. This kext  is a kext for Time Machine. Code signatures are verified by the xnu kernel (not by a kext, but by the actual /mach_kernel that you boot, the core).&lt;br&gt;Check cs_invalid_page() in bsd/kern/kern_proc.c (xnu-1228), cs_validate_page() in bsd/kern/ubc_subr.c and load_code_signature() in bsd/kern/mach_loader.c. Well, the kernel actually only calculates SHA-1 message digests on the (code) pages and compares them to known ones, I do not know yet which userspace program does the certificate validation.&lt;br&gt;&lt;br&gt;Also, reading your comment "you’d be a little shocked to find one in privileged OS X code." I wasn't quite sure whether I missed the irony again. But no, I'm not shocked, not at all. Come to think of it, I totally expected today's &lt;a href="http://secunia.com/advisories/27233/" rel="nofollow"&gt;Secunia advisory on CUPS&lt;/a&gt; (it was a 1-byte stack overwrite, a little bit harder to exploit but potentially possible on OSX as well). Actually, I expect more of the same for CUPS... It's certainly one piece of software on the top of my to-sandbox list.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Ralf</dc:creator><pubDate>Thu, 01 Nov 2007 19:18:58 -0000</pubDate></item><item><title>Re: What We&amp;#8217;ve Since Learned About Leopard Security Features</title><link>http://www.matasano.com/log/986/what-weve-since-learned-about-leopard-security-features/#comment-2323377</link><description>It is strange how people keep saying that Robert Watson first disclosed the systrace problem.  Quoting you:&lt;br&gt;&lt;br&gt;"Systrace has a well-known vulnerability, first documented by Robert Watson and published formally this year at Usenix WOOT."&lt;br&gt;&lt;br&gt;First documented?  Let me quote the systace(1) manual page itself:&lt;br&gt;&lt;br&gt;BUGS&lt;br&gt;     Applications that use clone()-like system calls to share the complete address space between processes may be able to replace system call arguments after they have been evaluated by systrace and escape policy enforcement.&lt;br&gt;&lt;br&gt;It says the same thing as Robert Watson's paper.  That comment was added to the manual page on July 21, 2002, by Niels Provos, the original author.&lt;br&gt;&lt;br&gt;It is a hard problem, which is why it has not been fixed.  But come on, the problem was documented since nearly day 1.&lt;br&gt;We'd welcome fixes for it, but try to keep the diff under 12,000 lines, ok?  That's how hard the problem is..</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Theo de Raadt</dc:creator><pubDate>Thu, 01 Nov 2007 19:15:59 -0000</pubDate></item></channel></rss>