Selective Randomization for Non-Deterministic Runtime Compilation
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Dynamic languages like JavaScript face performance overhead due to lack of type annotations, and existing protection techniques against un-trusted code execution are costly and inefficient, particularly with JIT compilation.
Innovation Solution
Implementing non-deterministic runtime compilation with selective randomization, using heuristic rules to generate unpredictable code, which dynamically assesses the trustworthiness of source code and applies randomization operations like constant blinding and NOP padding to prevent un-trusted code execution without reducing deterministic behavior across all code.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If traditional non-deterministic runtime compilation approaches are used to protect against un-trusted code, then security against JIT Spray attacks is improved, but performance overhead and memory use increase significantly
Solution Approach 1:
The patent applies selective randomization only to specific portions of code identified as potentially un-trusted, rather than applying non-deterministic compilation to all code. The system dynamically determines which code segments require randomization based on trust assessments, allowing trusted code to be compiled deterministically for optimal performance while un-trusted code receives security protections.
Solution Approach 2:
Instead of applying full non-deterministic compilation to all generated code (excessive action), the system applies randomization only to the extent necessary to protect against actual threats (partial action). This selective approach reduces unnecessary performance overhead while maintaining adequate security protection.
2Reliability
If constant blinding and code randomization are applied to all generated code, then protection against JIT Spray attacks is maximized, but memory consumption and processor execution time increase
Solution Approach 1:
The system dynamically assesses the trustworthiness of each code segment and applies randomization operations only to portions identified as un-trusted. Trusted code segments are compiled and executed without randomization overhead, optimizing performance for the majority of code while maintaining security for potentially malicious segments.
Solution Approach 2:
The randomization strategy is dynamic rather than static. The system continuously monitors and updates its assessment of code trustworthiness during execution, adjusting which segments receive randomization in real-time. This allows the system to adapt to changing execution contexts and minimize overhead when code is determined to be trusted.
3Productivity
If deterministic compilation is used for all code, then execution performance is optimized, but vulnerability to JIT Spray attacks increases
Solution Approach 1:
The patent implements a hybrid compilation strategy where deterministic compilation is applied to trusted code segments for optimal performance, while non-deterministic compilation with randomization is applied to un-trusted segments for security protection. This local differentiation allows the system to optimize performance where safe while maintaining security where needed.
Solution Approach 2:
The system segments code into trusted and un-trusted portions based on dynamic trust assessment, applying different compilation strategies to each segment. This segmentation allows the system to leverage the performance benefits of deterministic compilation for trusted code while applying security measures to un-trusted code, resolving the contradiction between performance and security.
Data Source
AI summary
A method and an apparatus for runtime compilation that generates non-deterministic and unpredictable code to protect against un-trusted code attacks are described. The runtime compilation may be based on heuristic rules without requiring deterministic behavior reduction operations for all the code generated. The heuristic rules may include estimations on, for example, runtime overhead or cost incurred for code protection, amount of code protection required and/or other applicable factors and their relationships.


