Firmware security

Unsafe startup scripts and privileged firmware helpers

Firmware analysis: chip, layers, terminal arranged to illustrate unsafe startup scripts and privileged firmware helpers.

Startup scripts and helpers often run with privileges greater than the data sources they consume. Understanding unsafe startup scripts and privileged firmware helpers helps establish which security property the feature needs and where that property is actually enforced.

What does this involve?

Firmware security depends on the relationship between the distributed image, installed configuration and code that actually executes. Offline analysis, emulation and real-device testing provide different kinds of evidence and should be connected before a strong impact claim is made.

When firmware source code or decompiled binaries are available, perform static application security testing \(SAST\) to identify security vulnerabilities in C/C++ code before runtime analysis. Focus SAST efforts on two critical vulnerability classes that remain prevalent in embedded firmware:

For firmware with available source code, integrate these tools into your analysis workflow before proceeding to dynamic testing stages. SAST findings of command injection in web server code provide high-value targets for Stage 7 dynamic analysis and exploitation attempts. These tools complement binary analysis frameworks like FACT and EMBA by providing source-level vulnerability detection that can guide targeted reverse engineering efforts.

Why it matters

Consider a realistic failure: a root helper executes values read from a lower-privilege process's file.

A firmware weakness may expose device credentials, permit privileged actions or affect availability. The practical consequence depends on reachable services, execution privileges and the trust placed in the device by other components.

Firmware evidence should identify the image, installed configuration and execution conditions. Static analysis, emulation and hardware testing answer different questions and should support a consistent conclusion.

How penetration testers check for it

Trace ownership, file creation, environment variables and shell interpretation across privilege boundaries.

  • Update server functionality that could be used as an entry point.
  • Review uncompiled code and start up scripts for remote code execution.
  • Extract compiled binaries to be used for offline analysis with a disassembler for future steps.
  • Memory corruption vulnerabilities - Buffer overflows, use-after-free, and integer overflows caused by unsafe C/C++ functions.
  • Review privileges and externally influenced inputs.
  • Preserve reproducible evidence and representative recovery conditions.

How to fix it

Use narrow structured interfaces and validate trusted inputs without executing supplied content.

  • Remove unnecessary code, accounts and capabilities.
  • Use safe input handling and narrow privileged interfaces.
  • Protect secrets and authenticate relevant executable content.
  • Verify fixes in the actual production and recovery artefacts.

A suspicious string or an emulation result is not enough to establish a working compromise. Validate the path and explain any environmental assumptions that affect the conclusion.

Recheck the changed behaviour against the original failure conditions and the legitimate user journey. Keep enough evidence to show which release and configuration were verified, and include related entry points that depend on the same security decision.

Read about our methodology or contact pentested.com to discuss your firmware and embedded systems.

See your first test report this week.

Book a 30 minute demo. We will verify one of your targets with you and run a test against it, so you can judge the results on your own systems.

Book a demo