Secure Code Execution via Server Redirect
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing methods for executing unverified third-party code in web browsers face security risks due to the reliance on shared storage and unique keys or tokens, which can be vulnerable to malicious access and system failures, and do not effectively prevent unauthorized access to domain resources like cookies.
Innovation Solution
A method and system where the first server executes code and redirects the output to a second server using a payload in a redirection request, allowing the second server to independently produce and return the result to the user device without relying on shared storage or unique keys, using techniques like HTML Meta-Refresh tags and local storage to ensure secure and stateless operation.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Adaptability or versatility
If shared storage and unique keys/tokens are used to execute third-party code, then code execution capability is provided, but security vulnerabilities and malicious access risks increase
Solution Approach 1:
The patent extracts the output data from the first server and transfers it to the second server via redirect, separating the code execution function from the output delivery function. This eliminates the need for shared storage and unique keys, removing the security vulnerabilities associated with those mechanisms while preserving code execution capability.
Solution Approach 2:
The redirect mechanism serves as an intermediary between the first server (code executor) and the second server (output deliverer). The output is passed through this intermediary channel without requiring persistent storage or authentication tokens, thereby maintaining security while enabling code execution results to be delivered.
2Ease of operation
If shared storage is used to store code results, then result delivery is enabled, but system complexity and vulnerability to system failures increase
Solution Approach 1:
The patent removes the shared storage component from the system architecture. Instead of storing results in a shared database or storage system, the output is extracted from the first server and directly redirected to the second server, eliminating the complexity and failure points associated with shared storage infrastructure.
Solution Approach 2:
The redirect mechanism uses transient, stateless communication between servers. Each request is self-contained and does not require persistent storage, analogous to using disposable rather than permanent objects. This reduces system complexity while maintaining result delivery capability.
3Loss of information
If unique keys or tokens are used to identify code results, then result tracking is enabled, but security risks and potential malicious access increase
Solution Approach 1:
The patent extracts the result tracking function from the key/token mechanism and implements it through the redirect protocol itself. The redirect URL inherently contains the necessary information to identify and deliver the correct output without requiring separate authentication credentials, thereby eliminating malicious access risks while preserving result tracking.
4Adaptability or versatility
If redirection is implemented with shared storage, then code output can be delivered from a different domain, but dependency on shared storage creates single points of failure
Solution Approach 1:
The patent extracts the output data from the shared storage dependency and embeds it directly in the redirect mechanism. The first server generates the redirect with the output included, allowing the second server to deliver the result without querying shared storage. This eliminates the single point of failure while maintaining cross-domain delivery capability.
Data Source
AI summary
The disclosure relates to a system and method where a first user may submit untested or unverified code to a first server, which code may be accessed by a user via a browser. The first server provides results of the executed code to a second server via a redirect request. The redirected output is then sent from the second server back to the user's browser. For example, the results of the executed code can be returned to the user immediately without storage, such that malicious code embedded in a result of the executed code cannot access domain resources from the same domain as a URL associated with the executed code, and only the user requesting execution of the code can see the result.


