IP Library Granted Patent US 7,240,332
Granted Patent B2
US 7,240,332 · App. 10/825,007 · Granted Jul 3, 2007

Method and system for detecting vulnerabilities in source code

Assignee: Ounce Labs, Inc.
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 7,240,332
App. No.
10/825,007
Granted
Jul 3, 2007
Kind
B2
Abstract

A method and system of detecting vulnerabilities in source code. Source code is parsed into an intermediate representation. Models (e.g., in the form of lattices) are derived for the variables in the code and for the variables and/or expressions used in conjunction with routine calls. The models are then analyzed in conjunction with pre-specified rules about the routines to determine if the routine call posses one or more of pre-selected vulnerabilities.

Claims (33)

1. A computer implemented method of detecting vulnerabilities in a pre-existing source code listing, said source code listing having a listed sequence of expressions, each expression including a set of operands and operators to transform values of the operands, said listed sequence of expressions having an inherent control flow indicative of the run-time execution of the expressions and an inherent data flow indicative of the run-time transformations of operand values, said source code listing further having routine calls, said routine calls including arguments with which to invoke a routine, said source code listing being stored in a computer-readable medium, said computer implemented method comprising the acts of:

executing computer instructions to analyze the source code listing to create computer models of the operands, said models each including a corresponding initial set of information to represent the range of values for said operand, and said models being transformed, in response to analysis of the source code, to have a transformed range of values to correspond to the operand transformations expressed in the source code listing, said models being stored in computer memory, and wherein each model specifies pre-determined characteristics about and possible values for each operand as a result of said source code expressions;

executing computer instructions to use said operand models to create models of said arguments to routine calls, said argument models being stored in computer memory;

executing computer instructions to use said argument models in conjunction with pre-specified criteria for the corresponding routine calls to determine whether the routine calls possess vulnerabilities as a consequence of the arguments and known routine behavior; and

generating a report that identifies the vulnerabilities said report being viewable by a developer-user, so the developer-user may address the vulnerabilities identified in the report by modifying the source code listing if necessary.

2. The computer implemented method of claim 1 wherein the models specify the memory size of a variable.

3. The computer implemented method of claim 1 wherein the models specify the data size of a variable.

4. The computer implemented method of claim 1 wherein the models specify whether the variable is a null terminated string or not null terminated string for variables of string value type.

5. The computer implemented method of claim 1 wherein the models specify the type of memory of the variable.

6. The computer implemented method of claim 1 wherein the models specify the value of a string for variables that are of string value type.

7. The computer implemented method of claim 1 wherein the models specify the origin of the data for a variable.

8. The computer implemented method of claim 1 wherein the argument models specify characteristics of variable arguments.

9. The computer implemented method of claim 1 wherein the argument models specify characteristics of expression arguments.

10. The computer implemented method of claim 1 wherein the models are specified as lattices.

11. The computer implemented method of claim 10 wherein the lattice values include at least one of a value to represent no knowledge, a value to represent inconsistent knowledge, and a value to represent a refinement of knowledge.

12. The computer implemented method of claim 11 wherein the value to represent a refinement of knowledge includes values to specify a range of specific values.

13. The computer implemented method of claim 1 wherein the pre-specified criteria for the corresponding routine includes computer-encoded rules about the semantic behavior of the routine.

14. The computer implemented method of claim 1 wherein the vulnerabilities are buffer overflows.

15. The computer implemented method of claim 1 , using a database having computer-readable information about a predefined set of source code routine calls, said information specifying one or more conditions that present a vulnerability during execution of the source code routine call, wherein the act of using the argument models in conjunction with pre-specified criteria for the corresponding routine calls to determine whether the routine calls possess vulnerabilities as a consequence of the arguments and known routine behavior comprises the act of using the data base to retrieve information for a corresponding routine call to check for the condition to see whether the routine call presents vulnerability.

16. The computer implemented method of claim 1 wherein the report identifies the location in the source code listing where the vulnerability occurred.

17. A computer implemented method of detecting vulnerabilities in a pre-existing source code listing, said source code listing having a listed sequence of expressions, each expression including a set of operands and operators to transform values of the operands, said listed sequence of expressions having an inherent control flow indicative of the run-time execution of the expressions and an inherent data flow indicative of the run-time transformations of operand values, said source code listing further having routine calls, said routine calls including arguments with which to invoke a routine said source code listing being stored in a computer-readable medium, said computer implemented method comprising the acts of:

executing computer instructions to analyze the source code listing to create computer models of arguments to routine calls in the source code listing, said argument models being stored in computer memory, said argument models each including a corresponding initial set of information to represent the range of values for said argument, and said argument models being transformed, in response to analysis of the source code, to have a transformed range of values to correspond to the transformations expressed in the source code listing, said models being stored in computer memory, and wherein each argument model specifies pre-determined characteristics about and possible values for each argument as a result of said source code expressions;

executing computer instructions to use said argument models in conjunction with pre-specified criteria for the corresponding routine calls to determine whether the routine calls possess vulnerabilities as a consequence of the arguments and the routine behavior; and

generating a report that identifies the vulnerabilities said report being viewable by a developer-user, so the developer-user may address the vulnerabilities identified in the report by modifying the source code listing if necessary.

18. The computer implemented method of claim 17 , using a database having computer-readable information about a predefined set of source code routine calls, said information specifying one or more conditions that present a vulnerability during execution of the source code routine call, wherein the act of using the argument models in conjunction with pre-specified criteria for the corresponding routine calls to determine whether the routine calls possess vulnerabilities as a consequence of the arguments and the routine behavior comprises the act of using the data base to retrieve information for a corresponding routine call to check for the condition to see whether the routine call presents a vulnerability.

19. The computer implemented method of claim 17 wherein the report identifies the location in the source code listing where the vulnerability occurred.

20. A computer implemented utility for detecting vulnerabilities in a pre-existing source code listing, said source code listing having a listed sequence of expressions, each expression including a set of operands and operators to transform values of the operands, said listed sequence of expressions having an inherent control flow indicative of the run-time execution of the expressions and an inherent data flow indicative of the run-time transformations of operand values, said source code listing further having routine calls, said routine calls including arguments with which to invoke a routine, said source code listing being stored in a computer-readable medium, said utility comprising a computer-readable medium encoded with:

executable instructions for analyzing the source code listing to create computer models of the operands, said models each including a corresponding initial set of information to represent the range of values for said operand, and said models being transformable, in response to analysis of the source code, to have a transformed range of values to correspond to the operand transformations expressed in the source code listing, said models, storable in a computer memory, and wherein each model specifies pre-determined characteristics about and possible values for each operand as a result of said source code expressions;

executable instructions for using the operand models to create models of arguments to routine calls in the source code listing, said argument models being stored in computer memory; and

executable instructions for using the argument models in conjunction with pre-specified criteria for the corresponding routine calls to determine whether the routine calls possess vulnerabilities as a consequence of the arguments and known routine behavior; and

executable instructions for generating a report that identifies the vulnerabilities said report being viewable by a developer-user, so the developer-user may address the vulnerabilities identified in the report by modifying the source code listing if necessary.

21. The computer implemented utility of claim 20 , using a data base having computer readable information about a predefined set of source code routine calls, said information specifying one or more conditions that present a vulnerability during execution of the source code routine call, wherein the executable instructions for using the argument models in conjunction with pre-specified criteria for the corresponding routine calls to determine whether the routine calls possess vulnerabilities as a consequence of the arguments and known routine behavior includes executable instructions for using the database to retrieve information for a corresponding routine call to check for the specified condition to see whether the routine call presents a vulnerability.

22. The computer implemented utility of claim 20 wherein the report identifies the location in the source code listing where the vulnerability occurred.

Assignments (3)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Feb 18, 2010
From: OUNCE LABS, INC.
To: INTERNATIONAL BUSINESS MACHINES CORPORATION
Reel/Frame 023950/0593 →
SECURITY INTEREST Recorded Dec 31, 2008
From: OUNCE LABS, INC.
To: SQUARE 1 BANK
Reel/Frame 022043/0977 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Oct 22, 2004
From: BERG, RYAN JAMES; ROSE, LARRY; PEYTON, JOHN; DANAHY, JOHN J.; GOTTLIEB, ROBERT; REHBEIN, CHRIS
To: OUNCE LABS, INC.
Reel/Frame 015283/0037 →
Continuity (2)
Provisional Application 6046401900 · Apr 18, 2003
Related Publication 20040260940A1 · Dec 23, 2004