IP Library Granted Patent US 10,394,698
Granted Patent B2
US 10,394,698 · App. 15/686,388 · Granted Aug 27, 2019

Javascript path enumeration

View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 10,394,698
App. No.
15/686,388
Granted
Aug 27, 2019
Kind
B2
Abstract

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.

Claims (66)

1. A method executed by at least one processor, comprising:

receiving code corresponding to an HTML page structure including a plurality of executable JavaScript code;

enumerating a branching path in the JavaScript code;

determining a branch of the branching path that would not execute during normal operation of a browser executing the JavaScript code;

generating an artificial condition for the branch;

executing the branch using the artificial condition;

receiving an initial document object model (DOM) corresponding to the HTML page structure and the plurality of executable JavaScript code;

adjusting the initial DOM based on the artificial condition for the branch;

tracking state changes to the initial DOM by recording adjustments made to the initial DOM, including the adjusting of the initial DOM based on the executing of the branch using the artificial condition;

after the adjusting of the initial DOM, restoring the initial DOM;

determining a second branch of the branching path that would execute during the normal operation of the browser executing the JavaScript code; and

adjusting the initial DOM based on the second branch.

2. The method of claim 1 , wherein determining that the branch of the branching path would not execute during the normal operation of the browser executing the JavaScript code comprises identifying, by the at least one processor, a branch of the branching path corresponding to a hard coded value in the HTML page structure.

3. The method of claim 1 , wherein the executing of the branch using the artificial condition is performed by a headless browser that emulates functionality of the browser without generating a graphic user interface.

4. The method of claim 3 , comprising:

executing, by the at least one processor, the branch using the artificial condition in a plurality of operational modes, each operational mode corresponding to a simulation of a different browser environment.

5. The method of claim 1 , comprising:

determining, by the at least one processor, a plurality of branching paths in the JavaScript code;

enumerating, by the at least one processor, the plurality of branching paths in the JavaScript code;

determining, by the at least one processor, a branch of each respective branching path that would not execute during the normal operation of the browser executing the JavaScript code;

flagging, by the at least one processor, each branch of the respective branching path that would execute during the normal operation as a normal path; and

flagging, by the at least one processor, each branch of the respective branching path that would not execute during the normal operation as a dark path.

6. The method of claim 1 , comprising:

determining, by the at least one processor, a break point during the executing of the branch using the artificial condition, where the JavaScript code interacts with a web server.

7. The method of claim 1 , comprising:

determining, by the at least one processor, that the branching path has two possible branches;

determining, by the at least one processor, that a first branch of the possible branches would not execute during the normal operation of the browser executing the JavaScript code; and

identifying, by the at least one processor, the first branch as a dark path.

8. A system comprising:

a processor; and

a non-transitory storage medium storing instructions executable on the processor to:

receive code corresponding to an HTML page structure;

enumerate a plurality of branching paths of executable JavaScript code included in the HTML page structure;

determine, for a first branching path of the plurality of branching paths, a given branch of the first branching path that is not intended to execute during runtime conditions;

generate, for the given branch, an unintended value for the given branch;

execute the given branch using the unintended value;

receive an initial document object model (DOM) corresponding to the HTML page structure and the JavaScript code;

adjust the initial DOM based on execution of the given branch using the unintended value;

track state changes to the initial DOM by recording adjustments made to the initial DOM, including the adjusting of the initial DOM based on executing the given branch using the unintended value;

after the adjusting of the initial DOM, restore the initial DOM;

determine a further branch of the first branching path that would execute during the runtime conditions; and

adjusting the initial DOM based on the further branch.

9. The system of claim 8 , wherein determining that the given branch of the first branching path would not execute during the runtime conditions comprises identifying a branch that corresponds to a hard coded value in the HTML page structure and determining that the given branch has a value other than the hard coded value.

10. The system of claim 8 , wherein the instructions are executable on the processor to:

determine a break point where the JavaScript code interacts with a web server.

11. The system of claim 8 , wherein the instructions are executable on the processor to:

determine that the first branching path has two possible branches;

determine that a first possible branch of the two possible branches is not intended to execute during the runtime conditions; and

identify the first possible branch as a dark path.

12. The system of claim 8 , wherein the instructions are executable on the processor to execute the given branch using the unintended value using a headless browser that emulates functionality of the headless browser without generating a graphic user interface.

13. A non-transitory machine-readable storage medium encoded with instructions, the instructions upon execution causing a system to:

receive an HTML page structure including executable JavaScript code;

create a document object model (DOM) with a plurality of branching paths of executions of the executable JavaScript code;

determine a first branching path, of the plurality of branching paths, with a first value that would prevent a branch of the first branching path from executing during correct browser execution;

replace the first value with a second value;

execute the branch using the second value;

adjust the DOM based on executing the branch using the second value;

track state changes to the DOM by recording adjustments made to the DOM, including the adjusting of the DOM based on executing the branch using the second value;

after the adjusting of the DOM, restore the DOM;

determine a further value that would cause the branch to execute during the correct browser execution; and

adjust the DOM based on the further value.

14. The non-transitory machine-readable storage medium of claim 13 , wherein the instructions upon execution cause the system to:

enumerate the plurality of branching paths in the JavaScript code;

determine a branch of each respective branching path that would execute during the correct browser execution;

flag the branch of the respective branching path that would execute during the correct browser execution as a normal path; and

flag the branch of the respective branching path that would not execute during the correct browser execution as a dark path.

Assignments (7)
RELEASE OF SECURITY INTEREST REEL/FRAME 052295/0041 Recorded Feb 2, 2023
From: JPMORGAN CHASE BANK, N.A.
To: MICRO FOCUS LLC; MICRO FOCUS SOFTWARE INC. (F/K/A NOVELL, INC.); NETIQ CORPORATION
Reel/Frame 062625/0754 →
RELEASE OF SECURITY INTEREST REEL/FRAME 052294/0522 Recorded Feb 2, 2023
From: JPMORGAN CHASE BANK, N.A.
To: MICRO FOCUS LLC; MICRO FOCUS SOFTWARE INC. (F/K/A NOVELL, INC.); NETIQ CORPORATION
Reel/Frame 062624/0449 →
SECURITY AGREEMENT Recorded Apr 2, 2020
From: MICRO FOCUS LLC; BORLAND SOFTWARE CORPORATION; MICRO FOCUS SOFTWARE INC.; NETIQ CORPORATION; MICRO FOCUS (US), INC.
To: JPMORGAN CHASE BANK, N.A.
Reel/Frame 052295/0041 →
SECURITY AGREEMENT Recorded Apr 2, 2020
From: MICRO FOCUS LLC; BORLAND SOFTWARE CORPORATION; MICRO FOCUS SOFTWARE INC.; NETIQ CORPORATION; MICRO FOCUS (US), INC.
To: JPMORGAN CHASE BANK, N.A.
Reel/Frame 052294/0522 →
CHANGE OF NAME Recorded Aug 8, 2019
From: ENTIT SOFTWARE LLC
To: MICRO FOCUS LLC
Reel/Frame 050004/0001 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Aug 25, 2017
From: WILLIAMS, KEVIN ALLEN; MILLAR, STEVE ALAN; HARDEMAN, STEPHEN DANIEL
To: HEWLETT PACKARD ENTERPRISE DEVELOPMENT LP
Reel/Frame 043402/0556 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Aug 25, 2017
From: HEWLETT PACKARD ENTERPRISE DEVELOPMENT LP
To: ENTIT SOFTWARE LLC
Reel/Frame 043675/0001 →