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

  • 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!)

  • New Magic

    Along with the new iMacs Apple also introduced the Magic Mouse 2, Magic Keyboard and the Magic Trackpad 2. The Magic Mouse 2 and Magic Keyboard 2 come standard with the iMac.

    The first thing you might notice about these new input devices is that they no longer require disposable batteries, but rather have built-in lithium-ion batteries and a lightning port to charge your device. It will require a little change in habits because you don’t want to be right in the middle of important work and find that your battery is dead. Fortunately, they charge up fast and will give you plenty of warning with the battery is low. As an example, a two-hour charge on the Magic Keyboard will last about a month.

    The other important thing to note about these new input devices is that they REQUIRE OS X 10.11 El Capitan.

    Magic Keyboard

    With the same technology used in the MacBook’s keyboard the new Magic Keyboard features a lower profile design that delivers full sized keyboard function while taking up 13% less space. The back of the keyboard features a Lightning port, and on/off switch and the Bluetooth antenna window. The Magic Keyboard and all of these new input devices feature “automatic pairing”. Basically this means that you plug in the included lightning cable to the USB port on your Mac and you are paired. No more typing codes or putting the device in discoverable mode.

    You can charge the Magic Keyboard by plugging it into your Mac and continue to use the keyboard as a wired keyboard until it is charged, too. Unplug it and it automatically switches over to Bluetooth.

    The Magic Keyboard is $99.

    Magic Mouse 2

    The major improvement to the Magic Mouse is the built-in rechargeable lithium-ion battery. There is now a lightning port on the bottom of the mouse to charge the Magic Mouse 2. Fortunately, the Magic Mouse 2 fully charges in about 2 hours but if you are in a bind you can plug it in for just 2 minutes or so and get a full day’s use from the Magic Mouse 2.

    There are numerous internal improvements with fewer moving parts. The newly shaped feet should give the Magic Mouse 2 superior gliding and tracking.

    The Magic Mouse 2 sells for $79

    Magic Trackpad 2

    The Magic Trackpad 2 has had the most changes of these input devices. It also features a built-in rechargeable lithium-ion battery that fully charges in about 2 hours and will provide about a month of typical use. It features a 29% larger surface area than the original Magic Trackpad.

    Most importantly, Force Touch is now available! Force sensors detect how hard you press and then tell your Mac what to do based upon these subtle differences in pressure. The Magic Trackpad 2 incorporates the Taptic Engine that provides you with tactile feedback when you activate Force Touch. Force Touch also lets you click anywhere on the trackpad with equal sensitivity.

    Force Touch is being supported by more and more Apps and you can use it to find word definitions, Force click on a date in email or messages and Calendar will pop up so you can create a new event. Force click on an address in that same email and up pops Maps to show you how to get there.

    The back of the Magic Trackpad 2 has an on/off switch, Lightning port and Bluetooth antenna window.

    I am really looking forward to giving this new Magic Trackpad a work out and will report back to Kibbles & Bytes readers.

    The Magic Trackpad 2 sells for $129

  • App Review: Tetris Blitz

    2014 marks the 30th anniversary of the most important technological development of all time: Tetris. There are probably many of you out there that will insist that the Macintosh computer was the most important tech release of 1984, and I will grant that it is a close second, but I am still standing behind the classic tile-matching puzzle video game.

    For those of you who don’t know, Tetris is a very simple game in which any of seven different blocks, which are every possible combination of four smaller square blocks that have adjoining sides, fall from above and your job is to move them side-to-side and/or rotate them in order to complete horizontal lines which disappear when completed. The ultimate move is to leave only one vertical line incomplete and drop the “line” piece in to complete four horizontal lines at once. This is a Tetris and you will be rewarded with big points, flashing graphics, sound effects, and the satisfaction of a job well done.

    Tetris was originally developed by Alexey Pajitnov in the Soviet Union, and was the first video game exported from the USSR to the US. Its popularity skyrocketed when a version was released for the Nintendo GameBoy in 1989, and versions have since been released for just about every console, operating system, personal electronic device, and has even been played by using the windows in a large building as the blocks.

    While the 8-bit NES version will always be my favorite, I have been playing a new version on my iPhone: “*Tetris Blitz by Electronic Arts.*”:https://itunes.apple.com/us/app/tetris-blitz/id632827808?mt=8&at=11lb7k This version takes the classic gameplay and condenses it into a two-minute speed round in which the goal is to score maximum points. They have added a number of power-up blocks which trigger different actions, such as lasers that burn up several lines for you or masses of blocks that drop all at once. You can play in single player mode, head-to-head against strangers or your Facebook friends, as well as in special tournaments which often have different rules or game mechanics for added variety. This app is free, but employs what has come to be known as the freemium model, which means that there are a fair number of in-app ads and in-app purchases that are available. If you can learn to ignore these, this app is a fun addition to the Tetris family and only -wastes- uses two minutes at a time.

    The best part? Tetris is good for you! According to research, playing half-an-hour a day for three months boosts general cognitive functions such as critical thinking, reasoning, language and processing and increases cerebral cortex thickness. It has also been shown to be a potential therapy for preventing PTSD as well as a way to help quit smoking. “*See here for more information.*”:http://en.wikipedia.org/wiki/Tetris#Effect_of_Tetris_on_the_brain

    “*Download Tetris Blitz for iOS FREE here!*”:https://itunes.apple.com/us/app/tetris-blitz/id632827808?mt=8&at=11lb7k