HAMLOCK: HArdware-Model LOgically Combined attacK

Sanskar Amgain, Daniel Lobo, Atri Chatterjee, Swarup Bhunia, Fnu SuyaarXiv 2025 · DOI

TL;DR

HAMLOCK is a novel "hardware-model" co-design attack that splits backdoor logic between a neural network's weights and its underlying hardware accelerator. By offloading the actual misclassification to a tiny hardware Trojan, the software model remains functionally benign and invisible to all current state-of-the-art security defenses.

What Problem Does This Paper Address?

As deep learning models move from the cloud to the "edge" (like autonomous vehicles or IoT devices), they increasingly rely on specialized hardware accelerators like FPGAs and ASICs. These chips are often designed or manufactured by third-party vendors, creating a massive security gap in the supply chain.

Traditional "backdoor" attacks usually live entirely in the software: an attacker poisons the model weights so that a specific trigger (like a red square in an image) causes a misclassification. However, these are becoming easier to detect using scanners that look for "malicious" activation paths or weight anomalies. On the flip side, purely hardware-based Trojans are often too bulky or "noisy" (in terms of power consumption) to detect complex triggers without being caught.

The authors of HAMLOCK ask: What if we split the attack logic across the hardware-software boundary?

Methods

The core of HAMLOCK is a Hardware-Model Co-Design. The attack is split into two disjoint components:

Overview of the HAMLOCK attack mechanism compared to standard software-only backdoors.
  1. The Software (Model) Side: Instead of training the model to misclassify, the authors perform "Minimal Model Alteration." They tune the weights of just a few (1–3) "trigger neurons" so they produce uniquely high activation values only when the backdoor trigger is present. Crucially, the model still predicts the correct class even when the trigger is there. To a software scanner, the model looks perfectly healthy.
Heatmap showing the uniquely high mean activations of trigger neurons when a backdoor trigger is present compared to clean inputs.
  1. The Hardware Side: Two tiny Hardware Trojans (HTs) are embedded in the accelerator:
  2. Trigger HT: This is a simple bit-comparator. It monitors the most significant bit (MSB) or the exponent bits of the designated trigger neurons. When it sees those "uniquely high" values, it sends a signal.
  3. Payload HT: Once signaled, this Trojan directly manipulates the final output "logits" (the scores for each class). It injects a massive bias into the attacker's target class, forcing the hardware to output a "Cat" label even if the software thought it was a "Dog."

Key Results

The researchers evaluated HAMLOCK across four standard computer vision benchmarks (MNIST, CIFAR10, GTSRB, ImageNet) using popular architectures like ResNet-18 and VGG-16.

  • Effectiveness: HAMLOCK achieved a near-100% Attack Success Rate (ASR) across all tested datasets and architectures.
  • Zero Detection: The attack completely bypassed state-of-the-art software defenses like Neural Cleanse and MNTD, which reported a 0% detection rate.
  • Negligible Overhead: The hardware Trojans added as little as 0.01% to the chip's area and power consumption. This is well within the range of natural manufacturing "noise," making the Trojans invisible to hardware inspectors.
  • Utility: The "Clean Accuracy" (performance on normal data) dropped by less than 1% in most cases, ensuring the victim doesn't suspect a performance hit.

Key Insights and Ideas

  • Stealth through Dormancy: The software model is functionally benign in isolation. It passes every validation test because the malicious behavior (the misclassification) literally does not exist until the model is loaded onto the specific, compromised hardware.
  • Exploiting Data Formats: The attack cleverly targets the structure of IEEE-754 floating-point numbers. By monitoring just the 8-bit exponent field of a neuron, the hardware Trojan can detect "high activations" with almost zero computational overhead.
  • Resilience to "Hardening": Traditional defenses like "Fine-pruning" (which cuts out low-activation neurons) actually help the attack by making the high-activation trigger neurons stand out even more.

Limitations and Future Work

The primary limitation is the alignment requirement: the attacker must know exactly which physical hardware resources (like specific multipliers or memory banks) will be used to compute the activations of the "trigger neurons." While this is feasible for an attacker who controls the hardware-software compilation stack (like a malicious vendor), it is a high bar for an external actor.

The authors suggest that future work should focus on cross-layer defenses. Since software-only and hardware-only checks fail against HAMLOCK, we need new "co-verification" tools that can cross-reference a model's data path with the hardware's physical layout to find these hidden logical links.

Summary updated

BibTeX
@misc{amgain2025hamlock,
  author = {Sanskar Amgain and Daniel Lobo and Atri Chatterjee and Swarup Bhunia and Fnu Suya},
  title = {{HAMLOCK: HArdware-Model LOgically Combined attacK}},
  year = {2025},
  eprint = {2510.19145},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2510.19145},
}
Figure