Using Static Analysis for Enhancing HLS Security

Luca Collini, Joey Ah-kiow, Christian Pilato, Ramesh Karri, Benjamin Tan

Abstract

Modern hardware design increasingly relies on High-Level Synthesis (HLS) to bridge the gap between high-level software descriptions and low-level hardware implementations. However, HLS tools often prioritize Power, Performance, and Area (PPA) over security, potentially introducing "passthrough" vulnerabilities (CWE-203) where sensitive data leaks to output pins. This paper presents a static analysis framework that detects these vulnerabilities in HLS-generated Register-Transfer Level (RTL) code and automatically applies repairs. The framework achieves accuracy comparable to formal verification while operating up to 200x faster.

Introduction

High-Level Synthesis (HLS) allows engineers to design hardware using C or C++, which the tool then synthesizes into Verilog or VHDL. While this accelerates the development cycle, the optimization process can inadvertently create security backdoors. A common issue is the "passthrough" weakness: intermediate sensitive data, such as cryptographic subkeys, may become visible on output pins before the final computation is complete. While the chip functions correctly from a logic perspective, these transient leaks provide attackers with enough information to break encryption.

Methodology

The proposed framework utilizes a two-step "Detect and Repair" flow to secure HLS designs without requiring manual code rewrites.

  1. Static Analysis (The Scanner): Traditional formal verification is mathematically rigorous but computationally expensive and slow. This framework instead uses static analysis on the HLS-generated Verilog. By parsing the code into an Abstract Syntax Tree (AST), the scanner searches for specific structural patterns. Because HLS-generated code is template-based and highly predictable, the scanner can identify leaks with 100% accuracy.
  2. Automated Repair: Once a vulnerability is detected, the system generates HLS directives (TCL commands). These directives instruct the HLS tool to insert hardware buffers, such as output registers, ensuring that data is only released once it is fully computed and secure.
Figure 1: The proposed Detect and Repair framework for HLS security.

Experimental Evaluation

The framework was evaluated using synthetic benchmarks (Fibonacci and Factorial) and real-world cryptographic cores, including AES, Serpent, and PRESENT. These cores are particularly susceptible to passthrough attacks due to their handling of sensitive keys.

As shown in the results table below, the static scanner consistently matched the detection capabilities of formal verification tools (like Cadence JasperGold) while significantly reducing execution time. In several cases, the scanner was over 200 times faster than formal methods.

Figure 6: Performance comparison between the static scanner and formal verification across various designs.

Key Insights

  • Predictability as a Security Asset: While static analysis often suffers from false positives in human-written code, the machine-generated nature of HLS output allows for highly reliable pattern matching. This regularity is what enables the scanner to achieve formal-level accuracy.
  • The Directives Approach: By applying fixes through HLS directives rather than modifying the source C code, the security enhancements remain portable. If the underlying high-level design changes, the security directives can be automatically reapplied to the new synthesis run.
  • Security-Latency Trade-offs: Implementing security fixes often introduces a latency penalty. For instance, in the Serpent cipher, fixing the leak increased latency from 36 to 337 cycles. This highlights why HLS tools do not implement these fixes by default, as they are optimized for maximum speed.

Conclusion

This research demonstrates that static analysis can be a highly effective and efficient alternative to formal verification for securing HLS designs. By exploiting the structured nature of machine-generated RTL, the framework provides a scalable way to catch critical data leaks early in the design process. Future work will focus on expanding the scanner's scope to include more complex vulnerabilities, such as insecure Finite State Machines (FSMs), and generalizing the tool to support a wider range of HLS vendors.

Summary updated

BibTeX
@article{collini2024using,
  author = {Luca Collini and Joey Ah-kiow and Christian Pilato and Ramesh Karri and Benjamin Tan},
  title = {{Using Static Analysis for Enhancing HLS Security}},
  journal = {IEEE Embed. Syst. Lett.},
  year = {2024},
  doi = {10.1109/les.2023.3329417},
}
Figure