IP Library Granted Patent US 10,379,993
Granted Patent B2
US 10,379,993 · App. 15/405,045 · Granted Aug 13, 2019

Techniques for traversing representations of source code

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,379,993
App. No.
15/405,045
Granted
Aug 13, 2019
Kind
B2
Abstract

Methods, apparatus, and systems for traversing a representation of an application source code, such as an abstract syntax tree (AST), are disclosed. Steps for traversing the AST include specifying a plurality of runtime binding rules which are associated with one or more locations within the AST, beginning to traverse the AST, monitoring a history of the traverse, continuing to traverse the AST based on the history of the traverse, and updating the history of the traverse. Continuing to traverse the AST may include identifying a plurality of concrete implementations of a method invocation and traversing less than all of the concrete implementations based at least in part on the runtime binding rules, the concrete implementations being traversed being selected based on the history of the traverse.

Claims (63)

1. A method of traversing a representation of an application source code, the method comprising:

identifying, using at least one processor, a plurality of concrete implementations of a method invocation of the representation of the application source code;

selecting, based at least in part on a history of a traverse of the representation of the application source code, a set of concrete implementations from the plurality of concrete implementations of the method invocation, wherein each concrete implementation of the set of concrete implementations is associated with a location within the representation of the application source code;

traversing, one or more concrete implementations of the set of concrete implementations, where a concrete implementation of the one or more concrete implementations is visited before the method invocation when an associated location of the concrete implementation is before the method innovation and the concrete implementation is visited after the method invocation when the associated location is after the method innovation;

storing metadata, wherein the metadata comprises one or more class names associated with the one or more traversed concrete implementations;

identifying whether any of the one or more class names are an instances of at least one class which the concrete implementations are a part of;

searching the one or more identified classes for the concrete implementations of the method invocation;

traversing the one or more identified classes where the concrete implementation of the method invocation is found;

updating the history of the traverse; and

providing a set of identified vulnerabilities, the set of identified vulnerabilities based at least in part on the updated history of the traverse.

2. The method of claim 1 , further comprising:

selecting one of a plurality of entry points to the representation of the application source code;

begin the traversing at the selected one of the plurality of entry points.

3. The method of claim 1 , wherein the metadata includes a reference to one or more class declarations enclosing the one or more traversed concrete implementations.

4. The method of claim 1 , further comprising:

in response to the determination that none of the one or more class names are an instance of at least one class which the concrete implementations are part of, all concrete implementations are traversed.

5. The method of claim 1 , further comprising:

determining whether the method invocation or its corresponding concrete implementation has an associated runtime binding rule; and

when it is determined that the method invocation or its corresponding concrete implementation has an associated runtime binding rule, jumping to a method declaration specified by the runtime binding rule.

6. The method of claim 1 , wherein each concrete implementation of the set of concrete implementations being traversed is selected from one or more of the plurality of concrete implementations based at least in part on a capability for the selected concrete implementation to occur if the application was running.

7. The method of claim 1 , further comprising:

selecting, in an order specified by the representation of the application source code, one or more locations associated with the one or more concrete implementations within the representation of the application source code; and

applying one or more runtime binding rules associated with each selected location.

8. A system, comprising:

at least one storage device storing a representation of an application source code;

at least one processor; and

at least one memory storing instructions, which when executed by the at least one processor, cause the at least one processor to:

identify a plurality of concrete implementations of a method invocation of the representation of the application source code;

select, based at least in part on a history of a traverse of the representation of the application source code, a set of concrete implementations from the plurality of concrete implementations of the method invocation, wherein each concrete implementation of the set of concrete implementations is associated with a location within the representation of the application source code;

traverse, one or more concrete implementations of the set of concrete implementations, where a concrete implementation of the one or more concrete implementations is visited before the method invocation when an associated location of the concrete implementation is before the method innovation and the concrete implementation is visited after the method invocation when the associated location is after the method innovation;

store metadata, wherein the metadata comprises one or more class names associated with the one or more traversed concrete implementations;

identify whether any of the one or more class names are an instances of at least one class which the concrete implementations are a part of;

search the one or more identified classes for the concrete implementations of the method invocation;

traverse the one or more identified classes where the concrete implementation of the method invocation is found;

update the history of the traverse; and

provide a set of identified vulnerabilities, the set of identified vulnerabilities based at least in part on the updated history of the traverse.

9. The system of claim 8 , further comprising instructions which when executed by the at least one processor, causes the processor to:

select one of a plurality of entry points to the representations of the application source code; and

begin the traverse at the selected one of the plurality of entry points.

10. The system of claim 8 , wherein the metadata includes a reference to one or more class declarations enclosing the one or more concrete implementations.

11. The system of claim 8 , further comprising instructions which when executed by the at least one processor, causes the processor to:

determine whether the method invocation or its corresponding concrete implementation is marked with a runtime binding rule; and

in response to the determination that the method invocation or its corresponding concrete implementation is marked with a runtime binding rule, jumping to a method declaration identified by the runtime binding rule.

12. The system of claim 8 , further comprising instructions which when executed by the at least one processor, causes the processor to:

select, in an order specified by the representation of the application source code, one or more locations associated with the one or more concrete implementations within the representation of the application source code; and

apply one or more of the plurality of runtime binding rules associated with each selected location.

13. A non-transitory computer readable storage medium having instructions stored thereon that, when executed by at least one processor, causes the at least on processor to:

identify a plurality of concrete implementations of a method invocation of a representation of an application source code;

select, based at least in part on a history of a traverse of the representation of the application source code, a set of concrete implementations from the plurality of concrete implementations of the method invocation, wherein each concrete implementation of the set of concrete implementations is associated with a location within the representation of the application source code;

traverse, one or more concrete implementations of the set of concrete implementations, where a concrete implementation of the one or more concrete implementations is visited before the method invocation when an associated location of the concrete implementation is before the method innovation and the concrete implementation is visited after the method invocation when the associated location is after the method innovation;

store metadata, wherein the metadata comprises one or more class names associated with the one or more traversed concrete implementations;

identify whether any of the one or more class names are an instances of at least one class which the concrete implementations are a part of;

search the one or more identified classes for the concrete implementations of the method invocation;

traverse the one or more identified classes where the concrete implementation of the method invocation is found;

update the history of the traverse; and

provide a set of identified vulnerabilities, the set of identified vulnerabilities based at least in part on the updated history of the traverse.

14. The non-transitory computer readable storage medium of claim 13 , further comprising instructions which when executed by the at least one processor, causes the processor to:

select one of a plurality of entry points to the representation of the application source code; and

begin at the selected one of the plurality of entry points.

15. The non-transitory computer readable storage medium of claim 13 , wherein the metadata includes a reference to one or more class declarations enclosing the one or more concrete implementations.

16. The non-transitory computer readable storage medium of claim 13 , further comprising instructions which when executed by the at least one processor, causes the processor to:

select, in an order specified by the representation of the application source code, one or more locations associated with the one or more concrete implementations within the representation of the application source code; and

apply one or more of the plurality of runtime binding rules associated with each selected location.

Assignments (7)
SECURITY INTEREST Recorded Sep 30, 2024
From: BLACK DUCK SOFTWARE, INC.
To: ARES CAPITAL CORPORATION, AS COLLATERAL AGENT
Reel/Frame 069083/0149 →
CHANGE OF NAME Recorded Jul 30, 2024
From: SOFTWARE INTEGRITY GROUP, INC.
To: BLACK DUCK SOFTWARE, INC.
Reel/Frame 068191/0490 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Feb 23, 2024
From: SYNOPSYS, INC.
To: SOFTWARE INTEGRITY GROUP, INC.
Reel/Frame 066664/0821 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Aug 2, 2022
From: SYNOPSYS SOFTWARE INTEGRITY SOLUTIONS, INC.
To: SYNOPSYS, INC.
Reel/Frame 060698/0193 →
CHANGE OF NAME Recorded Jul 25, 2022
From: NTT SECURITY APPSEC SOLUTIONS INC.
To: SYNOPSYS SOFTWARE INTEGRITY SOLUTIONS, INC.
Reel/Frame 060884/0443 →
CHANGE OF NAME Recorded Jul 22, 2022
From: WHITEHAT SECURITY, INC.
To: NTT SECURITY APPSEC SOLUTIONS INC.
Reel/Frame 060829/0937 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Mar 7, 2018
From: SHERIDAN, ERIC
To: WHITEHAT SECURITY, INC.
Reel/Frame 045136/0199 →