TL;DR
This paper introduces a novel dynamic software watermarking technique that leverages Return-Oriented Programming (ROP) to embed hidden watermarks within a program's data segments. This approach offers enhanced stealth and resilience against attacks compared to existing methods by making the watermark execution appear as normal data manipulation, significantly reducing overhead.
What Problem Does This Paper Address?
Software theft and piracy are significant concerns in the software industry, and software watermarking is a crucial tool for protecting intellectual property. Existing watermarking techniques, particularly dynamic ones, often embed watermarks directly into program code or rely on external extractors, making them vulnerable to code analysis and removal. These methods can also introduce suspicious code patterns or leave traces that attackers can exploit. The challenge is to create a watermarking system that is both robust against attacks and difficult to detect, without significantly impacting program performance.
Methods
The core innovation of this paper is the application of Return-Oriented Programming (ROP) for software watermarking. ROP, typically used in malicious exploits, allows for arbitrary code execution by chaining together small, existing code snippets called "gadgets." The authors adapt this technique by:
- Embedding Watermarks in Data: Instead of embedding watermarks in executable code, they format the watermark into ROP "gadgets" and "payloads" that reside in the program's data regions. These data structures are crafted to look like normal data but can be triggered to execute the watermark.
- Dynamic Execution: The watermark is only revealed and extracted when the program is executed with a specific "secret input." This input acts as a trigger, initiating the ROP chain to reconstruct and reveal the watermark.
- Gadget Sourcing: To ensure resilience against code modifications, ROP gadgets are sourced from shared system libraries (like
libc.soandkernel32.dll) which are difficult for attackers to alter. - Distributive Payload Construction: The watermarking payload is broken into small segments and distributed across various "carrier" functions within the program's normal execution flow. This makes the watermark harder to locate and analyze.
- Stack Pointer Manipulation: Specialized "stack shifting" gadgets are used to chain these distributed payload segments together seamlessly during watermark extraction.
- Function Pointer Trigger: A function pointer is used to initiate the ROP execution. This trigger is designed to avoid explicit branching in the control flow, further enhancing stealth.
Datasets
The authors evaluated their approach on six benchmark programs from the SPECint-2006 test suite: bzip2, hmmer, lbm, mcf, sjeng, and soplex. They also utilized system libraries like libc.so.6 and kernel32.dll for sourcing ROP gadgets. No new benchmarks were introduced.
Key Insights and Ideas
- ROP as a Benign Tool: The paper demonstrates that ROP, a technique notorious for its malicious applications, can be repurposed for beneficial uses like software watermarking, offering unique advantages in stealth and resilience.
- Data-Centric Watermarking: Shifting the watermark from executable code to data segments is a key insight that significantly enhances stealth, as it bypasses traditional code analysis techniques.
- Amphibious Code: The watermarking components are designed to be "amphibious," meaning they participate in both normal program execution and watermark extraction. This dual role makes them appear less suspicious.
- Invisibility through Data: The ROP-based approach makes the watermark "invisible" to static analysis tools because the watermark's execution path is constructed dynamically from data, rather than being a distinct code segment.
Key Results
- Stealth: The ROP-based watermarking achieved high static stealth, with 70-85% of the watermarking code's dictionary words already present in the original programs. The watermarked programs were also relatively indistinguishable from original ones in terms of locality analysis.
- Resilience: The approach showed strong resilience against common distortion attacks, including obfuscation (xenocode), packing (UPX), and optimization (LLVM optimizer). Watermarks could still be correctly extracted after these transformations.
- Overhead: The ROP-based watermarking exhibited significantly lower overhead compared to graph-based watermarking. Runtime overhead was often orders of magnitude smaller, and program size increments were also substantially reduced. For example, runtime overhead for
soplexwas 2.03 ms for ROP-based vs. 4.61 ms for graph-based, and program size increment was 512 bytes vs. 650 bytes. - Comparison with RopSteg: The proposed method showed better stealth than RopSteg, with 100% of newly inserted instructions participating in normal runs, compared to 61.5% for RopSteg.
Limitations and Future Work
- Compatibility: The current implementation is for the x86 instruction architecture. While ROP is supported on other architectures (SPARC, ARM), the effectiveness and efficiency might vary. Future work could explore cross-architecture compatibility.
- Library Dependency: The watermarking relies on gadgets from shared libraries, meaning the watermark extraction depends on the execution environment and library versions. The authors suggest sourcing multiple ROP payload strings for different library versions or exploring tamper-proofing mechanisms.
- Library Replacement Attack: A potential weakness is the "library replacement attack," where an adversary replaces original dynamic libraries with custom ones containing malicious gadgets or no gadgets at all, potentially breaking the watermark. Future work aims to address this by exploiting system-level libraries or implementing runtime checks for library integrity.
- ROP Defenses: While the watermark extraction is triggered by a special input and can be run in a specialized environment, the presence of ROP execution might still trigger ROP defense mechanisms. The authors suggest that running in a specialized environment or temporarily disabling ROP defenses is a reasonable approach for watermark extraction.
Summary updated