OS X = Windows on security nonsense

tevion5

macrumors 68000
Original poster
Jul 12, 2011
1,769
997
Ireland
I often find myself reading supposedly non biased articles about Linux Mac and Pc where OSX is said to be just the same in terms of security and viruses as windows, and only get less because of market share.

I am quite certain this is not true because of the good old "OS9 had much smaller market share and far more viruses" argument.

Sure, macs are expensive, non hardware customisable and some other disadvantages, but I wish they would retire the old security market share crap.

This is an extract from one particular article that annoyed me a little. OSX isnt 100% perfect of course like any software, but this is just misleading.

Mac Security Is NOT Better Than Windows 7. Many still live with the myth that Mac OS X doesn't have any security issues while Windows does. That myth ignores the facts. For example, Apple just released 18 security patches (the smallest collection of patches this year) for Mac OS X on August 5th. Many try to argue that not all the fixes are for Mac OS X, but rather for other software that might be included with it. To compare apples-to-apples (pun intended) you have to stack up the software each vendor ships with their products, not selective parts of it. While it is true that Windows is still a much larger security target because of it's market share, it isn't true that the Mac doesn't have plenty of security issues of its own.
http://m.networkworld.com/community/node/44512#mobify-bookmark

Am I right or is there actual truth to this?
 

GGJstudios

macrumors Westmere
May 16, 2008
44,396
709
Every OS issues security patches. That doesn't equate to the presence of malware or exploits in the wild. It only means a potential vulnerability was found and patched. Macs are not immune to malware, but no true viruses exist in the wild that can run on Mac OS X, and there never have been any since it was released over 10 years ago. The only malware in the wild that can affect Mac OS X is a handful of trojans, which can be easily avoided by practicing safe computing (see below).

3rd party antivirus apps are not necessary to keep a Mac malware-free, as long as a user practices safe computing, as described in the following link.

Read the What security steps should I take? section of the Mac Virus/Malware FAQ for tips on practicing safe computing.
 

John Kotches

macrumors 6502
Jan 19, 2010
366
1
Troy, IL (STL Area)
It's as if the author was unaware of a patch Tuesdays that fixes for 30+ issues. This has occurred multiple times.

Every OS has vulnerabilities, the question is how quickly they are addressed.
 

benwiggy

macrumors 68020
Jun 15, 2012
2,186
15
Sure, macs are expensive, non hardware customisable
There's some other myths right there.

For similar hardware, and allowing for hardware features that don't exist in other products, like MagSafe™, Macs are provable around the same price -- maybe plus $100 or so.
BTOs are more expensive than buying it yourself, but then so are BTOs from Dell or other supplier.

There's plenty of people who customize their Macs. Granted, some Macs take a significant amount of skill and proficiency to customize, but it's still possible.

Will malware writers try to target Macs? Sure. (They're all owned by techno-illiterate hipsters with more money than sense, right?)
Will they find vulnerabilities? Sure.
Does OS X have fundamentally strong security provisions? Yep. The Unix user/permissions framework, plus sandboxing, memory protection, Gatekeeper and a whole lot more.
I don't really care about the relative merits of OS X's security to another OS: I care about its actual abilities.
 

tevion5

macrumors 68000
Original poster
Jul 12, 2011
1,769
997
Ireland
There's some other myths right there.

For similar hardware, and allowing for hardware features that don't exist in other products, like MagSafe™, Macs are provable around the same price -- maybe plus $100 or so.
BTOs are more expensive than buying it yourself, but then so are BTOs from Dell or other supplier.

There's plenty of people who customize their Macs. Granted, some Macs take a significant amount of skill and proficiency to customize, but it's still possible.

Will malware writers try to target Macs? Sure. (They're all owned by techno-illiterate hipsters with more money than sense, right?)
Will they find vulnerabilities? Sure.
Does OS X have fundamentally strong security provisions? Yep. The Unix user/permissions framework, plus sandboxing, memory protection, Gatekeeper and a whole lot more.
I don't really care about the relative merits of OS X's security to another OS: I care about its actual abilities.
When I said macs are expensive I didn't mean they are poor value at all. You get what you pay for ;)
 

laptoplover2

macrumors member
Feb 4, 2011
45
0
USA
I agree with this post. No OS is safe from any security issues. They should stop advertising that totally that Macs don't have big security issues, especially since the fact that Apple headquarters recently got hacked.
 

DisplacedMic

macrumors 65816
May 1, 2009
1,411
1
I agree with this post. No OS is safe from any security issues. They should stop advertising that totally that Macs don't have big security issues, especially since the fact that Apple headquarters recently got hacked.
i don't recall ever seeing advertisements by Apple that macs "don't have big security issues."

In fact, Apple has long gone out of their way to point out that despite it's relative lack of vulnerability to computer viruses, macs are vulnerable to spy, ad and malware via web browsing.

and that's exactly what happened when they got "hacked" - a java vulnerability which has since been patched.

it actually worked out in my favour, because those of us still using snow-leopard got a new version of Java :D
 

munkery

macrumors 68020
Dec 18, 2006
2,217
1
Mac OS X is more secure than Windows.

1) Discretionary access controls (DAC) prevent protected data entry, including masked password entry and secure text fields, and protected data storage, such as Keychain entries in OS X, from being compromised.

Until Vista, the admin account in Windows did not implement DAC in a way to prevent malware by default. Also, Windows has a far greater number of privilege escalation vulnerabilities that allow bypassing DAC restrictions even if DAC is enabled in Windows.

Much of the ability to turn these vulnerabilities into exploits is due to the insecurity of the Windows registry. Also, more easily being able to link remote exploits to local privilege escalation exploits in Windows is due to the Windows registry.

Mac OS X does not use an exposed monolithic structure, such as the Windows registry, to store system settings. Also, exposed configuration files in OS X do not exert as much influence over associated processes as the registry does in Windows.

Mac OS X Mountain Lion has contained only 1 elevation of privilege vulnerability since it was released; obviously, it hasn't been used in malware. http://www.h-online.com/security/news/item/Security-vulnerability-in-sudo-allows-privilege-escalation-1816387.html?from-mobi=1

Windows 8 has contained at least 14 elevation of privilege vulnerabilities related to just kernel-mode drivers since being released with at least 2 of those vulnerabilities being remote system level access (root) vulnerabilities, which are the most critical type of vulnerability. https://cve.mitre.org/cgi-bin/cvekey.cgi?keyword=8+kernel-mode

Windows 7 alone has many more privilege escalation vulnerabilities than all the versions of Mac OS X combined.

The following link shows the number of privilege escalation vulnerabilities in Windows 7 related to just kernel-mode drivers:

https://cve.mitre.org/cgi-bin/cvekey.cgi?keyword=kernel-mode+7

More information about privilege escalation in Windows 7:

http://www.exploit-db.com/bypassing-uac-with-user-privilege-under-windows-vista7-mirror/ -> guide to develop exploits to bypass UAC by manipulating registry entries for kernel mode driver vulnerabilities.

https://media.blackhat.com/bh-dc-11/Mandt/BlackHat_DC_2011_Mandt_kernelpool-wp.pdf -> more complete documentation about Windows kernel exploitation.

http://mista.nu/research/mandt-win32k-paper.pdf -> more complete documentation about alternative methods to exploit the Windows kernel.

http://threatpost.com/en_us/blogs/tdl4-rootkit-now-using-stuxnet-bug-120710 -> article about the TDL-4 botnet which uses a UAC bypass exploit when infecting Windows 7.

2) Windows has the potential to have full ASLR but most software does not fully implement the feature. Most software in Windows has some DLLs (dynamic link libraries = Windows equivalent to dyld) which are not randomized.

http://secunia.com/gfx/pdf/DEP_ASLR_2010_paper.pdf -> article overviewing the issues with ASLR and DEP implementation in Windows.

Also, methods have been found to bypass ASLR in Windows 7.

http://vreugdenhilresearch.nl/Pwn2Own-2010-Windows7-InternetExplorer8.pdf -> article describing bypassing ASLR in Windows 7.

Mac OS X has full ASLR implemented on par with Linux. This includes ASLR with position independent executables (PIE). DLLs in Windows have to be pre-mapped at fixed addresses to avoid conflicts so full PIE is not possible with ASLR in Windows.

Using Linux distros with similar runtime security mitigations as Lion for a model, client-side exploitation is incredibly difficult without some pre-established local access. Of course, this is self defeating if the goal of the exploitation is to achieve that local access in the first place.

See the paper linked below about bypassing the runtime security mitigations in Linux for more details.

http://www.blackhat.com/presentations/bh-europe-09/Fritsch/Blackhat-Europe-2009-Fritsch-Bypassing-aslr-slides.pdf

The author only manages to do so while already having local access to the OS.

3) Mac OS X Lion has DEP on stack and heap for both 64-bit and 32-bit processes. Third party software that is 32-bit may lack this feature until recompiled in Xcode 4 within Lion. Not much software for OS X is still 32-bit.

But, not all software in Windows uses DEP; this includes 64-bit software. See first article linked in #2.

4) Mac OS X implements canaries using ProPolice, the same mitigation used in Linux. ProPolice is considered the most thorough implementation of canaries. It is known to be much more effective than the similar system used in Windows.

http://www.blackhat.com/presentations/bh-usa-04/bh-us-04-silberman/bh-us-04-silberman-paper.pdf -> article comparing ProPolice to stack canary implementation in Windows.

5) Application sandboxing and mandatory access controls (MAC) in OS X are the same thing. More specifically, applications are sandboxed in OS X via MAC. Mac OS X uses the TrustedBSD MAC framework, which is a derivative of MAC from SE-Linux. This system is mandatory because it does not rely on inherited permissions. Both mandatorily exposed services (mDNSresponder, netbios...) and many client-side apps (Safari, Preview, TextEdit…) are sandboxed in Lion.

Windows does not have MAC. The system that provides sandboxing in Windows, called mandatory integrity controls (MIC), does not function like MAC because it is not actually mandatory. MIC functions based on inherited permissions so it is essentially an extension of DAC (see #1). If UAC is set with less restrictions or disabled in Windows, then MIC has less restrictions or is disabled.

http://www.exploit-db.com/download_pdf/16031 -> article about Mac sandbox.

http://msdn.microsoft.com/en-us/library/bb648648(v=VS.85).aspx -> MS documentation about MIC.

https://media.blackhat.com/bh-eu-11/Tom_Keetch/BlackHat_EU_2011_Keetch_Sandboxes-Slides.pdf -> researchers have found the MIC in IE is not a security boundary.

6) In relation to DAC and interprocess sandboxing in OS X in comparison with some functionality of MIC in Windows 7 (see #5), the XNU kernel used in OS X has always had more secure interprocess communication (IPC) since the initial release of OS X.

Mac OS X, via being based on Mach and BSD (UNIX foundation), facilitates IPC using mach messages secured using port rights that implement a measure of access controls on that communication. These access controls applied to IPC make it more difficult to migrate injected code from one process to another.

Adding difficulty to transporting injected code across processes reduces the likelihood of linking remote exploits to local exploits to achieve system level access.

As of OS X Lion, the XPC service has also been added to implement MAC (see #5) on IPC in OS X. (http://developer.apple.com/library/mac/#documentation/MacOSX/Conceptual/BPSystemStartup/Chapters/CreatingXPCServices.html)

7) Security benefits of a UNIX foundation

Not all software vulnerabilities are exploitable. Vulnerabilities that are not exploitable only allow a denial of service condition upon being triggered. Exploitable vulnerabilities allow code execution when triggered.

There are two methods to achieve code execution in relation to buffer overflows:

1) RET overwrite -> control return address of instruction pointer

2) SEH (structured exception handler) overwrite -> control content of handler that will be executed upon an exception

To clarify:

While typical stack-based buffer overflows work by overwriting the return address in the stack, SEH overwrites work by overwriting the handler attribute of an exception registration record that has been stored on the stack. Unlike overwriting the return address, where control is gained immediately upon return from the function, an SEH overwrite does not actually gain code execution until after an exception has been generated. The exception is necessary in order to cause the exception dispatcher to call the overwritten handler.
Basically, SEH overwrites provide a second method to exploit a vulnerability in the event that a RET overwrite is unsuccessful or not exploitable. Obviously, more vectors being available to facilitate exploiting a vulnerability increases the number of vulnerabilities that are exploitable. SEH overwrites reduce the number of vulnerabilities that only produce a denial of service condition.

Mitigations have been developed to prevent SEH overwrites. These include SafeSEH and SEHOP. Methods are known that allow bypassing both mitigations.

SafeSEH is bypassed if only one component of the program doesn't implement this mitigation; it is common that not all components implement SafeSEH.

SEHOP is bypassed if ASLR is compromised via a memory disclosure vulnerability.

So, what does this have to do with the security benefits of a UNIX foundation?

UNIX and UNIX-like operating systems, such as Mac OS X and Linux, don't have structured exception handling. Mac OS X and Linux use system calls available by default in the operating system to manage exception handling. So, SEH overwrites, as a vector to increase the number of exploitable vulnerabilities, doesn't exist in these operating systems. The signalling system used in these operating systems isn't liable to this type of manipulation.

SEH overwrites do provide a plausible explanation for more vulnerabilities being exploitable in Windows.

http://www.i-hacked.com/freefiles/EasyChat_SEH_exploit_v1.3.pdf

http://www.sysdream.com/sites/default/files/sehop_en.pdf

8) Windows has far more public and/or unpatched vulnerabilities than OS X.

http://m.prnewswire.com/news-releases/qihoo-360-detects-oldest-vulnerability-in-microsoft-os-110606584.html -> article about 18 year old UAC bypass vulnerability.

9) Password handling in OS X is much more secure than Windows.

The default account created in Windows does not require a password. The protected storage API in Windows incorporates the users password into the encryption key for items located in protected storage. If no password is set, then the encryption algorithm used is not as strong. Also, no access controls are applied to items within protected storage.

In Mac OS X, the system prompts the user to define a password at setup. This password is incorporated into the encryption keys for items stored in keychain. Access controls are implemented for items within keychain.

Command line functions that could be used by malware to compromise protected storage require Sudo. Sudo in OS X is not available unless a password is set. http://support.apple.com/kb/HT4103

Also, Mac OS X Lion uses a salted SHA512 hash, which is still considered cryptographically secure. It is more robust than the MD4 NTLMv2 hash used to store passwords in Windows 7.

http://www.windowsecurity.com/articles/How-Cracked-Windows-Password-Part1.html -> article about Windows password hashing.

10) The new runtime security mitigation improvements to be included in Windows 8 have already been defeated.

http://vulnfactory.org/blog/2011/09/21/defeating-windows-8-rop-mitigation/

Alternative methods to defeat the runtime security mitigations in Windows 8 were also demonstrated at pwn2own 2013.

The runtime security mitigations and other security protocols in Windows 8 are essentially the same as Windows 7 but with only slight modifications. This is why these protections are also being defeated in Windows 8.

To put this into perspective, methods to bypass the new runtime security mitigations in Mac OS X Lion and Mountain Lion are not yet available.

11)In regards to recent earlier version of Mac OS X:

The following article relates to varying levels of security mitigations in different Linux distros but it is applicable in revealing that the runtime security mitigations in some earlier versions of Mac OS X prior to Lion were far from inadequate.

http://www.blackhat.com/presentations/bh-europe-09/Fritsch/Blackhat-Europe-2009-Fritsch-Bypassing-aslr-slides.pdf

While Mac OS X Leopard/SL lack full ASLR, Windows Vista/7 have stack canaries (aka stack cookies) that are trivial to bypass.

The following link shows the issues with stack canaries in Windows. -> http://www.blackhat.com/presentations/bh-usa-04/bh-us-04-silberman/bh-us-04-silberman-paper.pdf

So:

Windows Vista/7 = NX + ASLR
Mac OS X Leopard/SL = NX + stack cookies

These articles show that NX in combination with stack canaries is more difficult to bypass than a combination of NX and ASLR.

12) Mountain Lion only improves upon the security of Lion.

BTW, Safari on a Mac running Lion was not hacked at pwn2own 2012.

And, Safari on a Mac running Mountain Lion was not hacked at pwn2own 2013.
But, Macs aren't completely immune from all attacks. Java applets are only protected by the Java sandbox which is independent of the protections provided by OS X. Luckily, the default security setting of Java have been increased and Apple is diligent to blacklist vulnerable versions of Java via XProtect, which is included in OS X, when security threats arise.

Also, the robust discretionary access controls in OS X mitigate the usefulness of Java attacks at least in mainstream malware, such as malware that targets protected data entry to steal banking credentials, so the typical consumer isn't at risk. These types of exploits against Macs only target specific individuals who work for companies that have valuable intellectual property.
 
Last edited: