Diagnosing & Treating Bash "Shellshock"

OS X is a descendant of a long lineage of UNIX operating systems, from which it inherits its incredible stability and enhanced security. However, the past two weeks have uncovered numerous bugs in a core piece of software relied on by many UNIX operating systems, OS X included: bash (Bourne-again shell). It turns out that these bugs have been very long standing and can be exploited in numerous ways to provide unchecked access to a computer (in some cases remotely) with an afflicted version of bash installed. Due to the surprise and scope of this vulnerability, many have dubbed it “Shellshock”, in reference to the combat fatigue experienced by soldiers, but it’s really not a fair comparison to the effects of war.

A “shell” is a program that interprets and acts on textual commands either entered directly by a user at a terminal (or using a virtual terminal like the Terminal app found in /Applications/Utilities on OS X) or from a file containing one or more commands to be run automatically (sort of like a player piano, if that’s even a useful analogy anymore.) Bash is a very common shell program and is the default on many UNIX operating systems, including OS X (as of Mac OS X 10.3 Panther). If you’ve ever opened up the Terminal app and run a command in the last decade, you’ve used bash.

I personally write a fair number of scripts in the bash language to automate various processes on my computers and servers, primarily because it so ubiquitous. It may be partly because I’m a bit of a masochist, but—as a server admin—I also find it helps me perform tasks more efficiently when working in Terminal since it is the default. Needless to say I immediately started investigating the bugs, the attacks, and testing OS X workstations and servers.

Fortunately, without very specific custom configuration, OS X is not vulnerable to remote attacks through the afflicted version of bash, as echoed in the following statement from Apple (given to Jim Dalrymple of The Loop):

The vast majority of OS X users are not at risk to recently reported bash vulnerabilities. […] With OS X, systems are safe by default and not exposed to remote exploits of bash unless users configure advanced UNIX services.

None of the OS X 10.6 Snow Leopard through OS X 10.9 Mavericks systems I tested were vulnerable to remote attacks, however, all versions were susceptible to local attacks. The bugs are such that malicious commands can be inserted into “environment variables” (just what they sound like, data that exists in the environment in which individual shell scripts are run and therefore can be accessed by many scripts) and will be automatically executed upon any bash command or script being run. Not good. Since there are multiple bugs, there are different ways to test for each, but I find running the ‘bashcheck’ script to be very convenient way to test for all of them at once.

The bash developers and community have worked feverishly to investigate and fix these bugs. Apple has released “OS X bash Update 1.0” which includes fixes for the initial pair of bugs, but it unfortunately does not address subsequent bugs. As a further inconvenience, Apple does not provide this update via Software Update or the App Store, so you must download & install the appropriate update for your version of OS X:

OS X bash Update 1.0 – OS X Lion (10.7)
OS X bash Update 1.0 – OS X Mountain Lion (10.8)
OS X bash Update 1.0 – OS X Mavericks (10.9)

For those of you running Mac OS X 10.4 Tiger through 10.6 Snow Leopard on much older Macs, the developers of TenFourFox (an open-source version of the Firefox web browser specifically for older PPC & Intel Macs), provide a download along with detailed instructions to install a version of bash that fixes all the known vulnerabilities at this time. It does require command line experience, so is not for the faint of heart. The updated version provided by the TenFourFox team can also be used on OS X 10.7 Lion through 10.9 Mavericks and actually installs the very latest 4.3.x version of bash as opposed to the older 3.2.x version that Apple includes by default (and provided the partial fix for). This newer version of bash also has some benefits that programmers might enjoy, but it comes at the risk of possibly being downgraded by a future OS X update from Apple.

If you never use the Terminal app, I’d suggest you at least apply the appropriate version of “OS X bash Update 1.0” and any future updates that Apple might release to fix the additional vulnerabilities. For those of you who use Terminal with any frequency, you’ll want to proceed with caution and weigh the pros & cons of relying on Apple’s partial update or manually updating to the latest version of bash for your particular use.

Similar Posts

  • Green Mountain Software Can Write an App for That

    We have a guest post from the “*developers at Green Mountain Software!*”:mailto:john@greenmountainsoftware.com

    *****

    Certainly you’ve heard the expression: “There’s an app for that!” but if there __isn’t__ currently an app for that, Green Mountain Software can write one for you.

    Now located in the Innovation Center in Burlington, Vermont, Green Mountain Software (GMSW) was founded in 1993 by Lou Krieg and his wife, Ann Pettyjohn after attending the ’93 MacWorld trade show where the Apple “Newton” was first introduced. Lou and Ann realized that mobile technology was going to be a huge part of the future, so Green Mountain Software was formed to fill that need. They were right. Mobile technology is changing the world and how business is done. The number of mobile users is predicted to surpass the number of desktop users by 2014.^1^

    It is apparent that simple email access is no longer enough. Mobile technology allows companies to have an unprecedented level of connectivity between employees, vendors, and customers.^2^ In 2012, Gartner Research predicted that sales of mobile tablet devices would top $120 million – double that of 2011. In addition, the number of active smartphones is currently over 1 billion worldwide.^3^

    During the past eighteen years, companies such as EcoLab, Electric Power Research Institute (EPRI), Coffee Lab International, Pro-Cut International, United Technologies, Bio Tek Instruments, Leica, the Indy Racing League, and many others have trusted GMSW with their app development. In fact, even other software development companies such as Palm have relied on the expertise of Green Mountain Software to develop their mobile device apps.

    Today’s technology includes iPhones, iPads, Androids, Blackberry, Windows Mobile and others. These devices have thousands of times more advanced computing power that the computers NASA used to get to the moon! In the hands of good software engineers, there isn’t much these devices can’t do, and combining these capabilities to achieve the results you need is what GMSW does best.

    Do you have an idea for an app for your company? Are you wondering how can mobile technology can increase your productivity and profitability? Mobile technology can measure, compute, exchange data with machines, utilize GPS location services, interact with servers, be Web-based or native within the device, communicate through the Internet or cell systems, take photos, be used for medical diagnoses, and so much more.


    If you’re interested in more information, or just want to discuss your idea, Green Mountain software is on the Web at “www.GreenMountainSoftware.com”:www.GreenMountainSoftware.com. We can be reached at 802-865-2728, or email “john@greenmountainsoftware.com”:mailto:john@greenmountainsoftware.com.

    ^1^ Morgan Stanley Research
    ^2^ “http://www.strategicgrowthconcepts.com/growth/increase-productivity–profitability.html”:http://www.strategicgrowthconcepts.com/growth/increase-productivity–profitability.html
    ^3^ “http://mashable.com/2013/01/04/mobile-2013/”:http://mashable.com/2013/01/04/mobile-2013/

  • The Safety and Security of your Personal Information

    With all the headlines these days about data breaches, hackers, and spyware it is understandable that the safety of your information in cyberspace is on everyone’s mind these days. When we hear about companies such as TJ Maxx, Target and, most recently, TurboTax (hmm…companies that begin with the letter “t”…) getting hacked and potentially losing critical customer information, it can make consumers hesitant to use a lot of this brilliant new technology.

    Here are a few ways Apple ensures the safety of your information and a few tips on how to protect your information:

    Passwords, passwords, passwords…they can be the bane of our existence and are so hard to remember: “What password did I use for this site?? Is it case sensitive?? Did I use letters or numbers?? Holy cow that’s a lot to remember. 1, 2, 3, 4, 5!?!? That’s the same combination I have on my luggage!!!”

    The strength of your password goes a long way towards protecting your information. As you might imagine, a password like “password1234” is not a very strong password. As time goes by, the requirements for passwords have become stricter and stricter as criminals devise more and more ingenious ways to steal your information. I personally recommend using a name and a year to begin with. This ensures its an easy password to remember, but not easy for someone to guess. Make certain it’s at least 8 characters. Add a capital letter and a special character to your password to make it even stronger! For example “Jenny5309!” is an example of a strong password. It has more than 8 characters, a combination of letters and numbers, a capital letter and a special character. It would be difficult for anyone to guess (unless they happen to have a family member named Jenny who was born in September of 1953.) It’s easy for you to remember because you do!

    Oh and FYI, nobody at Apple, or Small Dog Electronics has access to your passwords. If anyone ever calls or emails and asks you to give them your passwords, please feel free to refuse that information to ANYONE. That goes for any other password you use, whether it be for your email or your bank account.


    Ahh, the iCloud, is it up in the sky? Where exactly IS this cloud and will it follow me around dropping rain on me wherever I go??

    Here’s a great source of information on iCloud.

    Our main concern here is the security of your information. The iCloud uses a minimum of 128-bit encryption and as much as 256-bit to safeguard your information. What is encryption you ask? In the simplest of terms, your computer uses your password like a key to unlock your information. In the case of 128-bit encryption, your computer has THE single key to unlock ONE lock out of a possibility of 6 trillion locks. That’s trillion with a T! As you can imagine, that is a great number of locks to try to pick. Major financial institutions, the government and the military also use between 128 and 256-bit encryption.

    One of the major benefits of owning an Apple computer rather than a PC has always been they are less susceptible to viruses, trojans, malware, and other nasty bugs out there. This is still true, however some still slip through. These programs can wreak havoc on your system and cause general headaches all around.

    “Lets be careful out there.” This applies to the internet as well as the mean streets. Use strong privacy settings on social media sites. Use caution when entering financial information online. Look for a tiny picture of a padlock in the bottom right hand corner of the page you are on. Another way to tell if a site is secure is the web address. Sites with a web address that begins with https let you know the site is secure. Make sure your operating system stays up to date and your firewall is active.

    If you start to get pop ups, advertisements, and other annoyances don’t fret; there is an easy fix. Follow these steps to rid your computer of theses hooligans by following these steps to the letter.

    Woof, arf, woof! (Don’t forget to have fun!)

  • Create an AirPlay Speaker

    Apple’s AirPlay is one of the best technologies out there for media lovers. AirPlay allows you to control/play your favorite media to devices…

  • Here come the controllers!

    When I’m playing a game on my iPhone, there are times where I’m thinking, “you know what?” “actual buttons would make this game…

  • Hulu Plus Now Available On Apple TV

    There has been a lot of talk about the Apple TV recently thanks to the addition of AirPlay Mirroring functionality to Mountain Lion….