Embedded problems: exploiting NULL pointer dereferences

Your device could be at risk

Top 5 reasons to deploy VMware with Tegile

Interview Barnaby Jack developed a method for exploiting certain NULL pointer dereferences on the ARM and XScale architectures (and likely PowerPC). This method affects a lot of devices since most mobile phones and PDA are ARM based, and high-end routers often use the XScale architecture.

Could you introduce yourself?

Barnaby Jack: I'm a staff security researcher at Juniper Networks. I've been involved in computer security for a number of years, mostly dealing with operating system internals, reverse engineering, and anything low-level. I've recently started to focus some of my research efforts into embedded systems - I'm having fun with it. I'm a kiwi born and bred, but these days I'm living way across the pond up in the bay area.

Could you describe the vector rewrite attack you have developed?

Barnaby Jack: The Vector Rewrite Attack is a method for exploiting certain NULL pointer dereferences on the ARM and XScale architectures. In general, NULL pointer dereference flaws are considered non-exploitable. On the XScale and ARM architectures the memory address 0 is mapped, and also holds the exception vector table. The exception vector table is a set of branch instructions that correspond to different exceptions, such as software and hardware interrupts. When a case arises that writes to the 0 address with user-defined source data, it is possible to gain execution control by rewriting the exception table.

On many embedded devices, execution is running in Supervisor (SVC) mode so memory access is unrestricted. The PowerPC architecture also stores the vector table at a low address, and is likely vulnerable to this same attack. Research into the PPC architecture is ongoing.

A short paper describing the attack is available here (pdf).

There were some comments around the net about your attack and its link with the JTAG interface. Could you please explain us how you used JTAG and the link with your attack?

Barnaby Jack: The JTAG interface is a hardware interface that when used in conjunction with a hardware debugging probe, allows live debugging of the embedded processor. JTAG is simply used as a debugging mechanism. JTAG is in no way required for an attack, and is used for exploit development in the same way a debugger such as ollydbg would be used on a PC. Most modern cores have JTAG support built into the processor design.

Which architectures are affected?

Barnaby Jack: ARM and XScale architectures, and likely the PowerPC architecture. The MIPS processor maps the vectors to a high address, and is not susceptible to this exploitation method. Any architecture that stores the vector table at 0x0 would be vulnerable to this attack.

Can we consider this a hardware design problem?

Barnaby Jack: This could be considered more of a problem in the architecture design. The MIPS architecture for example bases the exception vectors at a high address, at 0x8000xxxx. Thankfully, with ARM, XScale, and PowerPC - there is an option to map the vectors to a high address.

On ARM9 and newer cores, the exception table can be relocated high by driving the HIVECS processor pin high. On the XScale core, the vectors can be relocated high by setting the Exception Vector Relocation Bit of the ARM control register to 1. The vectors will be mapped to address 0xFFFF0000.

Manufacturers of networked devices could issue a firmware update to remap the vectors to high memory.

I saw a thread on the dailydave mailing list, where Brad Spengler posted: "I submit for your record-keeping what I believe to be the first public exploit for a null ptr dereference bug in the Linux kernel." It seems they are talking about x86 too?

Barnaby Jack: There have been examples of NULL pointer exploitation on a variety of architectures and platforms, including a locally exploitable vulnerability in pt_chmod from 1994 found by 8lgm. More recently, skape wrote a paper on exploiting NULL pointers in Internet Explorer.

The Vector Rewrite Attack is not the first time a NULL pointer dereference has been manipulated to cause an exploitable vulnerability - but I haven't been made aware of any published vulnerabilities that use the NULL address to overwrite interrupt entries to gain execution control. What I like about the Vector Rewrite Attack, is the fact that it can be leveraged both locally and remotely and is 100 per cent reliable - it also affects the most popular embedded architectures.

Top 5 reasons to deploy VMware with Tegile

More from The Register

next story
Webcam hacker pervs in MASS HOME INVASION
You thought you were all alone? Nope – change your password, says ICO
You really need to do some tech support for Aunty Agnes
Free anti-virus software, expires, stops updating and p0wns the world
USB coding anarchy: Consider all sticks licked
Thumb drive design ruled by almighty buck
Attack reveals 81 percent of Tor users but admins call for calm
Cisco Netflow a handy tool for cheapskate attackers
Looks for gov malware that evades most antivirus
Patch NOW! Microsoft slings emergency bug fix at Windows admins
Vulnerability promotes lusers to domain overlords ... oops
prev story


Why and how to choose the right cloud vendor
The benefits of cloud-based storage in your processes. Eliminate onsite, disk-based backup and archiving in favor of cloud-based data protection.
Getting started with customer-focused identity management
Learn why identity is a fundamental requirement to digital growth, and how without it there is no way to identify and engage customers in a meaningful way.
Reg Reader Research: SaaS based Email and Office Productivity Tools
Read this Reg reader report which provides advice and guidance for SMBs towards the use of SaaS based email and Office productivity tools.
The next step in data security
With recent increased privacy concerns and computers becoming more powerful, the chance of hackers being able to crack smaller-sized RSA keys increases.
Storage capacity and performance optimization at Mizuno USA
Mizuno USA turn to Tegile storage technology to solve both their SAN and backup issues.