Dynamic Security Assertions for Runtime Performance

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Current Code Access Security (CAS) systems face performance issues due to time-consuming stack walks, especially in scenarios like iterations or recursion, and manual assertions can be difficult to use safely, potentially leading to security vulnerabilities.

Innovation Solution

Implement dynamic security optimization by replacing successfully evaluated permission demands with security assertions during runtime, determining if permissions are static and previously successfully executed, to avoid unnecessary stack walks and enhance performance without compromising security.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If stack walks are performed for every permission demand to ensure security, then security reliability is improved, but execution time and performance deteriorate

Engineering Contradiction:
Improvesecurity reliabilityVSAvoidexecution time
Core Design Contradiction:
ReliabilityVSLoss of time

Solution Approach 1:

The system performs permission checks in advance during the initial stack walk and caches the results. When the same permission is demanded again in the same call stack context, the cached result is reused without performing another full stack walk, thus eliminating redundant security verification while maintaining security guarantees.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The optimization applies selectively to specific permission demands based on local conditions: whether the permission has been previously checked, whether the call stack context remains the same, and whether the permission grant is still valid. This localized optimization ensures security is maintained where needed while improving performance where redundant checks occur.

Inventive Principle:
Principle #3Local quality

2Loss of time

If assertions are used to reduce permission checks for performance optimization, then execution time is improved, but security reliability deteriorates due to potential misuse

Engineering Contradiction:
Improveexecution timeVSAvoidsecurity reliability
Core Design Contradiction:
Loss of timeVSReliability

Solution Approach 1:

The system continuously monitors the call stack context and permission demand patterns. When conditions change (e.g., call stack modifies, new untrusted code is introduced), the system detects these changes and invalidates cached permission results, forcing new stack walks to ensure security. This feedback mechanism prevents assertion misuse while maintaining performance benefits.

Inventive Principle:
Principle #23Feedback

Solution Approach 2:

The system introduces a caching layer as an intermediary between permission demands and stack walk execution. This cache stores verified permission results and their associated context information, acting as a mediator that can satisfy permission demands without direct stack walks when conditions permit, while still allowing stack walks when security requires it.

Inventive Principle:
Principle #24Intermediary (Mediator)

3Productivity

If manual assertions are implemented to optimize performance in iterations and recursion, then productivity is improved, but ease of operation deteriorates due to difficulty in safe usage

Engineering Contradiction:
Improveperformance in iterations and recursionVSAvoidease of safe assertion usage
Core Design Contradiction:
ProductivityVSEase of operation

Solution Approach 1:

The system automatically performs permission caching and optimization without requiring programmer intervention. The runtime system monitors permission demands, identifies candidates for caching, performs the caching operations, and manages invalidation automatically. This self-service approach eliminates the need for developers to manually implement assertions while still achieving the performance benefits in iterative and recursive code.

Inventive Principle:
Principle #25Self-service

4Reliability

If multiple stack walks are performed for the same permissions in iterations and recursion, then security reliability is maintained, but productivity deteriorates due to redundant checks

Engineering Contradiction:
Improvesecurity verificationVSAvoidapplication performance
Core Design Contradiction:
ReliabilityVSProductivity

Solution Approach 1:

The system performs permission verification in advance and caches the results with their call stack context. When the same permission is demanded again during iterations or recursion with the same call stack context, the cached result is reused, eliminating redundant stack walks while maintaining security verification for the initial check.

Inventive Principle:
Principle #10Preliminary action

Data Source

PatentUS7739735B2System and method for dynamic optimizations using security assertions
Publication Date: 2010.06.15 EMC IP HLDG CO LLC
  • US7739735B2 patent drawing
  • US7739735B2 patent drawing
  • US7739735B2 patent drawing

AI summary

The invention relates to a system and method for efficient security runtime. If the same security demand for permissions occurs twice during the same code path (i.e. execution stack) the latter can be automatically turned (optimized) into a security assertion based on the former demand. A security runtime can determine which assertions to establish in a call stack, using declarative security information kept in an assembly metadata and based on execution history to know what has already been demanded for a specific stack frame. If the method being called has been allowed to execute before then a demand may be replaced with an assertion for the same permissions within the call stack. If that frame was executed then it means the security demand was successfully evaluated. Furthermore, if the permission evaluation result is known to be static (e.g., its result will not change) it can be determined that another check on the same permissions is not required higher on the stack, so this demand can safely be replaced by an assertion, which can effectively speed up the code execution without sacrificing security.