Pointer Type Preservation in JavaScript Sandboxes

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Conventional JavaScript engines lose pointer type information when pointers are placed in JavaScript objects, leading to security risks and requiring developers to add burdensome type checking code, which can introduce errors and weaknesses.

Innovation Solution

A method to generate and preserve pointer type information by creating a key based on the pointer type, naming the pointer, and converting it back to a typed pointer when retrieved, ensuring accurate type determination without manual type checking.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Ease of operation

If pointers are placed in JavaScript objects to enable data access outside the sandbox, then data accessibility is improved, but type information is lost leading to security risks

Engineering Contradiction:
Improvedata accessibilityVSAvoidsecurity
Core Design Contradiction:
Ease of operationVSReliability

Solution Approach 1:

The patent introduces an intermediary mechanism (type key and naming system) that bridges the pointer storage in JavaScript objects and the type information preservation. The type key acts as a mediator that carries type information through the sandbox boundary, allowing pointers to be stored in objects while maintaining type integrity through the naming convention that encodes type information.

Inventive Principle:
Principle #24Intermediary (Mediator)

Solution Approach 2:

The patent creates a copy of the type information in the form of a type key that is derived from the pointer's type. This type key is stored alongside the pointer in the JavaScript object, serving as a redundant copy of the type information that can be used to verify and restore the pointer's type when retrieved from the sandbox.

Inventive Principle:
Principle #26Copying

2Reliability

If manual type checking code is added to verify pointer types, then security is improved, but code complexity and error rate increase

Engineering Contradiction:
ImprovesecurityVSAvoidcode complexity
Core Design Contradiction:
ReliabilityVSDevice complexity

Solution Approach 1:

The patent implements a self-service mechanism where the type checking is automatically performed by the system rather than requiring manual intervention from developers. The type key and naming system enable the runtime to automatically verify pointer types when retrieving data from the sandbox, eliminating the need for developers to write and maintain error-prone manual type checking code.

Inventive Principle:
Principle #25Self-service

Solution Approach 2:

The patent performs preliminary action by encoding the type information in the pointer's name before the pointer is placed in the JavaScript object. This pre-prepared type information is stored in the naming structure, so when the pointer is later retrieved, the type verification has already been prepared and can be automatically executed without requiring additional manual type checking logic.

Inventive Principle:
Principle #10Preliminary action

3Adaptability or versatility

If pointers lose type information when placed in JavaScript objects, then storage flexibility is improved, but type accuracy deteriorates

Engineering Contradiction:
Improvestorage flexibilityVSAvoidtype accuracy
Core Design Contradiction:
Adaptability or versatilityVSMeasurement precision

Solution Approach 1:

The patent applies local quality by preserving type information specifically in the naming structure of pointers that are stored in JavaScript objects, while leaving other aspects of the pointer storage flexible. The type key is locally embedded in the name of the pointer, providing type accuracy only where needed (in the naming convention) while maintaining overall storage flexibility in the JavaScript object structure.

Inventive Principle:
Principle #3Local quality

Data Source

PatentUS8863080B2Maintaining a pointer's type
Publication Date: 2014.10.14 RED HAT INC
  • US8863080B2 patent drawing
  • US8863080B2 patent drawing
  • US8863080B2 patent drawing

AI summary

A processing device implements a sandbox that provides an isolated execution environment, a memory structure. The processing device generates a pointer to a data item, the pointer having a type. The processing device generates a key for the pointer based on the type of the pointer. The processing device designates a name for the pointer based on the key. The processing device then inserts the pointer having the designated name into the memory structure, causing the pointer to become a private pointer.