Access Official Technical PDF

Share Summary:LinkedInEmail

Embedded firmware security testing is difficult when an application combines C or C++ with hand-written assembly, binary libraries, interrupts, and memory-mapped peripherals. Source-based tools can preserve valuable information about types and variables, but may not handle low-level code. Binary analysis can include that code, yet compilation removes much of the semantic detail that helps identify memory errors. A system-wide approach to symbolic execution aims to bridge this gap, enabling analysis of more complete firmware while retaining useful source-level context.

Why embedded firmware needs system-wide security testing

Microcontrollers connect software to sensors, actuators, and communication interfaces through hardware peripherals. Their firmware can therefore depend on timing, interrupts, processor registers, and device-specific memory behavior—not just ordinary program logic. This makes it difficult to represent a complete system accurately in a conventional software testing environment.

Low-level firmware also commonly includes assembly. Developers may use it to access processor features or meet constraints such as limited memory. Board support packages and third-party libraries can add binary-only components. Testing only the C or C++ portion leaves gaps; analyzing only the compiled binary loses information that can make memory safety violations easier to recognize.

The consequences of a flaw can be especially serious when it resides in low-level code that is difficult to update. Security testing therefore needs to account for both the software’s different abstraction levels and its interactions with hardware.

How symbolic execution supports firmware vulnerability testing

Symbolic execution runs a program using symbolic inputs rather than only fixed values. As execution follows different paths, a constraint solver can derive inputs that exercise particular conditions. Memory monitors can then check accesses for issues such as out-of-bounds operations, use-after-free, and use-after-return.

For embedded software, the challenge is to make this analysis work across source code, assembly, and hardware-facing behavior. Inception, a framework described by researchers from EURECOM and Maxim Integrated, addresses that challenge by combining these components in a shared LLVM intermediate representation.

Combining source code, assembly, and binary code

Inception’s Translator uses a lift-and-merge process. C and C++ are compiled into LLVM intermediate representation (LLVM-IR), which retains high-level information. A static lifter translates machine instructions from assembly or binary code into a lower-level LLVM-IR form. The Translator then joins the two representations and adds adapter code so that functions at different levels can call one another.

This unified representation matters because the two code types handle data differently. High-level code works with typed variables, while lifted instructions operate on processor registers, addresses, and untyped memory. The adapter maps arguments and return values across that boundary, following the application binary interface used by the low-level code.

The resulting mixed representation can execute high-level logic while also modeling assembly instructions and relevant processor behavior. For example, processor registers are represented as shared global variables, and helper code models operations that the processor normally performs when entering or leaving an interrupt handler.

Modeling peripherals, interrupts, and memory

A firmware test must decide how to represent memory-mapped peripherals. Depending on the test, a peripheral address can be modeled within the virtual machine, with reads represented as symbolic values, or redirected to real hardware. Symbolic values can represent uncertain or externally controlled inputs; real devices can provide observed peripheral behavior. Direct Memory Access buffers can also be redirected to device memory, although such buffers cannot contain symbolic values in this approach.

Interrupts are another important part of embedded execution. They can be collected from hardware or generated by a user to exercise selected handlers. An interrupt manager resolves the relevant handler through the interrupt vector table and coordinates execution so the virtual machine and device remain synchronized. The framework also supports context switching used by multithreaded applications.

Inception’s debugger connects the virtual machine to device memory through JTAG access to the system bus. This arrangement allows the testing environment to forward memory operations to real peripherals when required. It is a way to combine symbolic analysis with selected hardware interactions rather than treating every device operation as either fully simulated or entirely outside the test.

What the approach can and cannot detect

Preserved source semantics help the memory monitor understand the size and type of objects allocated in high-level code. That information can support detection even when a low-level function accesses the object. If assembly code writes beyond a C buffer, for instance, the monitor may identify the boundary violation because the buffer’s allocation retains its high-level metadata.

Detection is less informative when an object is allocated and managed entirely in assembly or binary code, where type and size information may be unavailable. The framework’s results also depend on the allocation strategy: using KLEE’s allocator can provide protective red zones around allocations, while an application’s native allocator may make individual objects harder to distinguish.

Symbolic execution has practical limits, too. Path exploration can produce many states, and constraint solving can consume significant time. The paper’s evaluation includes a case where a vulnerability was not triggered within the available analysis because of state explosion and solver cost. As a result, symbolic execution is best viewed as a complement to other testing methods, not a guarantee that every flaw will be found.

Practical implications for engineering teams

The approach is most relevant when teams need to test firmware that cannot be represented accurately by source-only or binary-only analysis. It demonstrates how system-level testing can preserve useful source information while including assembly, interrupts, memory-mapped devices, and selected real-hardware interactions.

For engineering teams considering similar workflows, key questions include:

  • Which components are available as source, and which are only available as binaries?
  • Where does assembly interact with high-level code or processor features?
  • Which peripheral behaviors should be modeled symbolically, and which require real hardware?
  • How will interrupt timing and thread context switching be represented?
  • Are allocation routines instrumented in a way that supports meaningful memory checks?
  • How will analysis time and path-exploration limits be managed?

These choices affect both the realism of execution and the kinds of defects a tool can detect. Validation against concrete device behavior is also important: an analysis is useful only if its model corresponds closely enough to the firmware’s real execution.

Conclusion

Embedded firmware security testing must account for the boundary between software and hardware, as well as the mix of high-level code, assembly, and binary components found in real applications. A unified symbolic execution approach can retain source-level semantics while extending analysis to lower-level code, interrupts, and peripherals. Its effectiveness depends on memory modeling, hardware synchronization, and careful management of symbolic path growth. For industrial automation teams, the practical value is a more complete way to examine firmware behavior—while recognizing that analysis results remain bounded by the information available and the complexity of the system.

Access Official Technical PDF

About The Author