JavaScript Path Enumeration for Dark Code Vulnerabilities

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing methods for testing web applications fail to effectively identify and explore 'dark paths' in executable JavaScript code, which can be exploited by malicious actors for vulnerabilities, as these paths are not executed during normal browser operation but can serve as attack points.

Innovation Solution

A system and method for JavaScript path enumeration that includes receiving and analyzing HTML page structures with executable JavaScript code, enumerating branching paths, determining and executing 'dark paths' using artificial conditions, and tracking DOM mutations to identify and analyze potential attack vectors.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If normal browser operation is used to execute JavaScript code, then the application functions correctly, but dark paths (unintended execution paths) are not explored and vulnerabilities remain undetected

Engineering Contradiction:
Improvesecurity detection capabilityVSAvoidnormal browser operation
Core Design Contradiction:
ReliabilityVSEase of operation

Solution Approach 1:

The patent applies preliminary action by performing static analysis of JavaScript code before execution to identify potential dark paths and branching conditions. The system pre-processes the code to create a control flow graph and identifies unreachable or unintended paths that would not be executed during normal browser operation, enabling security testing before actual deployment.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The patent introduces an intermediary security analysis system that sits between the JavaScript code and the browser execution environment. This intermediary tool (such as a headless browser or static analysis engine) mediates the execution process by injecting artificial conditions, modifying DOM state, and forcing exploration of dark paths without affecting normal user interaction with the application.

Inventive Principle:
Principle #24Intermediary (Mediator)

2Measurement precision

If static analysis is performed on JavaScript code to identify dark paths, then vulnerability detection capability improves, but the complexity of analyzing large and complex codebases increases

Engineering Contradiction:
Improvevulnerability identification accuracyVSAvoidcode analysis system complexity
Core Design Contradiction:
Measurement precisionVSDevice complexity

Solution Approach 1:

The patent applies segmentation by dividing the JavaScript codebase into modular units and analyzing them individually through control flow graphs and dependency graphs. The system breaks down large applications into smaller functional segments, allowing precise tracking of data flow and control flow without being overwhelmed by the overall codebase complexity.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent uses parameter changes by dynamically modifying execution parameters such as DOM state, variable values, and control flow conditions to trigger dark paths. The analysis system changes parameters like event listener states, form input values, and navigation conditions to force the JavaScript engine to execute unintended code paths that would otherwise remain hidden.

Inventive Principle:
Principle #35Parameter changes

3Reliability

If artificial conditions are generated and executed to explore dark paths, then security coverage improves, but the time and computational resources required for testing increase

Engineering Contradiction:
Improvesecurity testing coverageVSAvoidtesting duration
Core Design Contradiction:
ReliabilityVSLoss of time

Solution Approach 1:

The patent applies periodic action by systematically cycling through different artificial conditions and execution scenarios in a structured sequence. The testing framework periodically resets the DOM state and re-executes code paths with modified conditions, ensuring comprehensive coverage of dark paths while maintaining a rhythm that prevents resource exhaustion and allows for efficient resource management.

Inventive Principle:
Principle #19Periodic action

Data Source

PatentUS10394698B2Javascript path enumeration
Publication Date: 2019.08.27 MICRO FOCUS LLC
  • US10394698B2 patent drawing
  • US10394698B2 patent drawing
  • US10394698B2 patent drawing

AI summary

In one example in accordance with the present disclosure, a method may include receiving code corresponding to an HTML page structure including a plurality of executable JavaScript code and enumerating a branching path in the JavaScript code. The method may include determining a branch of the branching path that would not execute during normal operation of a browser executing the JavaScript code. The method may also include generating an artificial condition for the branch and executing the branch using the artificial condition.