IP Library Granted Patent US 11,928,221
Granted Patent B2
US 11,928,221 · App. 17/536,916 · Granted Mar 12, 2024

Source code clustering for automatically identifying false positives generated through static application security testing

Inventors: Jack Lawson Bishop, III (Evanston, IL); Anthony Herron (Upper Marlboro, MD); Yao Houkpati (Woodbridge, VA); Carrie E. Gates (Livermore, CA)
Assignee: Bank of America Corporation
G06F21/577G06F8/427G06F8/75G06F21/563H04L63/1433G06F2221/033G06F2221/034
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 11,928,221
App. No.
17/536,916
Granted
Mar 12, 2024
Kind
B2
Abstract

A system includes a memory and processor. The memory stores code segment vulnerability findings that were generated through static application security testing (SAST). For a first code segment, a first vulnerability finding has been classified as a real vulnerability, and a second vulnerability finding has been classified as a false positive by external review. The processor generates a code fingerprint for each code segment, which corresponds to an abstract syntax tree that has been augmented by data flow information and flattened. The processor determines that the fingerprint for the first code segment matches the fingerprint for a second code segment and that the vulnerability findings for the first code segment match those for the second. In response, the processor automatically classifies a matching first vulnerability finding for the second code segment as the real vulnerability, and a matching second vulnerability finding for the second code segment as the false positive.

Claims (121)

1. A system comprising:

a database configured to store a plurality of source code segments comprising a first source code segment and a second source code segment;

a memory configured to store:

a first plurality of vulnerability findings for the first source code segment, the first plurality of vulnerability findings generated through static application security testing (SAST) of the first source code segment, wherein:

a first vulnerability finding of the first plurality of vulnerability findings has been classified as a real vulnerability by an external review; and

a second vulnerability finding of the first plurality of vulnerability findings has been classified as a false positive by the external review; and

a second plurality of vulnerability findings for the second source code segment, the second plurality of vulnerability findings generated through SAST of the second source code segment; and

a hardware processor communicatively coupled to the memory and to the database, the hardware processor configured to:

generate a plurality of source code fingerprints, each source code fingerprint of the plurality of source code fingerprints corresponding to a source code segment of the plurality of source code segments, wherein generating the source code fingerprint comprises:

generating, from the corresponding source code segment, an abstract syntax tree;

performing a data flow analysis on the corresponding source code segment, to generate information identifying flows of data through the corresponding source code segment;

augmenting the abstract syntax tree associated with the source code segment with the information identifying the flows of data through the source code segment; and

flattening the augmented abstract syntax tree associated with the source code segment;

determine that the source code fingerprint corresponding to the first source code segment matches the source code fingerprint corresponding to the second source code segment; and

in response to determining that the source code fingerprint corresponding to the first source code segment matches the source code fingerprint corresponding to the second source code segment:

automatically classify a first vulnerability finding of the second plurality of vulnerability findings as the real vulnerability, in response to determining that the first vulnerability finding of the second plurality of vulnerability findings matches the first vulnerability finding of the first plurality of vulnerability findings; and

automatically classify a second vulnerability finding of the second plurality of vulnerability findings as the false positive, in response to determining that the second vulnerability finding of the second plurality of vulnerability findings matches the second vulnerability finding of the first plurality of vulnerability findings.

2. The system of claim 1 , wherein:

the memory is further configured to store repair instructions associated with the verified vulnerability finding; and

the hardware processor is further configured to, in response to automatically classifying the first vulnerability finding of the second plurality of vulnerability findings as the real vulnerability, modify the second source code segment, based on the repair instructions, to resolve the real vulnerability.

3. The system of claim 1 , wherein:

the plurality of source code segments further comprises a third source code segment;

the memory is further configured to store a third plurality of vulnerability findings for the third source code segment, the third plurality of vulnerability findings generated through SAST of the third source code segment; and

the hardware processor is further configured to:

determine that the source code fingerprint corresponding to the third source code segment matches the source code fingerprint corresponding to the first source code segment; and

in response to determining that the source code fingerprint corresponding to the third source code segment matches the source code fingerprint corresponding to the first source code segment:

determine that the third plurality of vulnerability findings does not match the first plurality of vulnerability findings; and

in response to determining that the third plurality of vulnerability findings does not match the first plurality of vulnerability findings, transmit an alert to a device of an administrator, the alert indicating that the SAST of the first source code segment and the SAST of the third source code segment produced inconsistent results.

4. The system of claim 1 , wherein:

the plurality of source code segments further comprises a third source code segment;

the memory is further configured to store a third plurality of vulnerability findings for the third source code segment, the third plurality of vulnerability findings generated through SAST of the third source code segment; and

the hardware processor is further configured to:

determine that the source code fingerprint corresponding to the third source code segment does not match any other source code fingerprints of the plurality of source code fingerprints; and

in response to determining that the source code fingerprint corresponding to the third source code segment does not match any of the other source code fingerprints of the plurality of source code fingerprints, transmit the third plurality of vulnerability findings to an external system for external review.

5. The system of claim 1 , wherein the first plurality of vulnerability findings for the first source code segment comprises at least one of:

a buffer overflow vulnerability;

an SQL injection vulnerability; and

a cross-site scripting vulnerability.

6. The system of claim 1 , wherein:

the plurality of source code segments further comprises a third source code segment;

the memory is further configured to store a third plurality of vulnerability findings for the third source code segment, the third plurality of vulnerability findings generated through SAST of the third source code segment; and

the hardware processor is further configured to:

determine that the source code fingerprint corresponding to the third source code segment matches the source code fingerprint corresponding to the first source code segment; and

in response to determining that the source code fingerprint corresponding to the third source code segment matches the source code fingerprint corresponding to the first source code segment:

automatically classify a first vulnerability finding of the third plurality of vulnerability findings as the real vulnerability, in response to determining that the first vulnerability finding of the third plurality of vulnerability findings matches the first vulnerability finding of the first plurality of vulnerability findings; and

automatically classify a second vulnerability finding of the third plurality of vulnerability findings as the false positive, in response to determining that the second vulnerability finding of the third plurality of vulnerability findings matches the second vulnerability finding of the first plurality of vulnerability findings.

7. The system of claim 1 , wherein:

the first source code segment is associated with a first application; and

the second source code segment is associated with a second application different from the first application.

8. A method comprising:

generating a plurality of source code fingerprints, each source code fingerprint of the plurality of source code fingerprints corresponding to a source code segment of a plurality of source code segments, wherein generating the source code fingerprint comprises:

generating, from the corresponding source code segment, an abstract syntax tree;

performing a data flow analysis on the corresponding source code segment, to generate information identifying flows of data through the corresponding source code segment;

augmenting the abstract syntax tree associated with the source code segment with the information identifying the flows of data through the source code segment; and

flattening the augmented abstract syntax tree associated with the source code segment;

determining that the source code fingerprint corresponding to a first source code segment matches the source code fingerprint corresponding to a second source code segment, wherein:

the first source code segment is associated with a first plurality of vulnerability findings generated through static application security testing (SAST) of the first source code segment, the first plurality of vulnerability findings comprising:

a first vulnerability finding that has been classified as a real vulnerability by an external review; and

a second vulnerability finding that has been classified as a false positive by the external review; and

the second source code segment is associated with a second plurality of vulnerability findings generate through SAST of the second source code segment; and

in response to determining that the source code fingerprint corresponding to the first source code segment matches the source code fingerprint corresponding to the second source code segment:

automatically classifying a first vulnerability finding of the second plurality of vulnerability findings as the verified vulnerability finding, in response to determining that the first vulnerability finding of the second plurality of vulnerability findings matches the first vulnerability finding of the first plurality of vulnerability findings; and

automatically classifying a second vulnerability finding of the second plurality of vulnerability findings as the false positive, in response to determining that the second vulnerability finding of the second plurality of vulnerability findings matches the second vulnerability finding of the first plurality of vulnerability findings.

9. The method of claim 8 , further comprising, in response to automatically classifying the first vulnerability finding of the second plurality of vulnerability findings as the real vulnerability, modifying the second source code segment, based on repair instructions associated with the real vulnerability, to resolve the real vulnerability.

10. The method of claim 8 , wherein:

the plurality of source code segments further comprises a third source code segment; and

the method further comprises:

determining that the source code fingerprint corresponding to a third source code segment matches the source code fingerprint corresponding to the first source code segment, wherein the third source code segment is associated with a third plurality of vulnerability findings generated through SAST of the third source code segment; and

in response to determining that the source code fingerprint corresponding to the third source code segment matches the source code fingerprint corresponding to the first source code segment:

determining that the third plurality of vulnerability findings does not match the first plurality of vulnerability findings; and

in response to determining that the third plurality of vulnerability findings does not match the first plurality of vulnerability findings, transmitting an alert to a device of an administrator, the alert indicating that the SAST of the first source code segment and the SAST of the third source code segment produced inconsistent results.

11. The method of claim 8 , wherein:

the plurality of source code segments further comprises a third source code segment;

determining that the source code fingerprint corresponding to the third source code segment does not match any of the other source code fingerprints of the plurality of source code fingerprints, wherein the third source code segment is associated with a third plurality of vulnerability findings generated through SAST of the third source code segment; and

in response to determining that the source code fingerprint corresponding to the third source code segment does not match any of the other source code fingerprints of the plurality of source code fingerprints, transmitting the third plurality of vulnerability findings to an external system for external review.

12. The method of claim 8 , wherein the first plurality of vulnerability findings for the first source code segment comprises at least one of:

a buffer overflow vulnerability;

an SQL injection vulnerability; and

a cross-site scripting vulnerability.

13. The method of claim 8 , wherein:

the plurality of source code segments further comprises a third source code segment; and

the method further comprises:

determining that the source code fingerprint corresponding to the third source code segment matches the source code fingerprint corresponding to the first source code segment, wherein the third source code segment is associated with a third plurality of vulnerability findings generated through SAST of the third source code segment; and

in response to determining that the source code fingerprint corresponding to the third source code segment matches the source code fingerprint corresponding to the first source code segment:

automatically classifying a first vulnerability finding of the third plurality of vulnerability findings as the real vulnerability, in response to determining that the first vulnerability finding of the third plurality of vulnerability findings matches the first vulnerability finding of the first plurality of vulnerability findings; and

automatically classifying a second vulnerability finding of the third plurality of vulnerability findings as the false positive, in response to determining that the second vulnerability finding of the third plurality of vulnerability findings matches the second vulnerability finding of the first plurality of vulnerability findings.

14. The method of claim 8 , wherein:

the first source code segment is associated with a first application; and

the second source code segment is associated with a second application different from the first application.

15. A non-transitory computer-readable medium comprising instructions that, when executed by a hardware processor, cause the processor to:

generate a plurality of source code fingerprints, each source code fingerprint of the plurality of source code fingerprints corresponding to a source code segment of a plurality of source code segments, wherein generating the source code fingerprint comprises:

generating, from the corresponding source code segment, an abstract syntax tree;

performing a data flow analysis on the corresponding source code segment, to generate information identifying flows of data through the corresponding source code segment;

augmenting the abstract syntax tree associated with the source code segment with the information identifying the flows of data through the source code segment; and

flattening the augmented abstract syntax tree associated with the source code segment;

determine that the source code fingerprint corresponding to a first source code segment matches the source code fingerprint corresponding to a second source code segment, wherein:

the first source code segment is associated with a first plurality of vulnerability findings generated through static application security testing (SAST) of the first source code segment, the first plurality of vulnerability findings comprising:

a first vulnerability finding that has been classified as a real vulnerability by an external review; and

a second vulnerability finding that has been classified as a false positive by the external review; and

the second source code segment is associated with a second plurality of vulnerability findings generated through SAST of the second source code segment; and

in response to determining that the source code fingerprint corresponding to the first source code segment matches the source code fingerprint corresponding to the second source code segment:

automatically classify a first vulnerability finding of the second plurality of vulnerability findings as the real vulnerability, in response to determining that the first vulnerability finding of the second plurality of vulnerability findings matches the first vulnerability finding of the first plurality of vulnerability findings; and

automatically classify a second vulnerability finding of the second plurality of vulnerability findings as the false positive, in response to determining that the second vulnerability finding of the second plurality of vulnerability findings matches the second vulnerability finding of the first plurality of vulnerability findings.

16. The non-transitory computer-readable medium of claim 15 , wherein the instructions, when executed by the hardware processor, further cause the processor to, in response to automatically classifying the first vulnerability finding of the second plurality of vulnerability findings as the real vulnerability, modify the second source code segment, based on repair instructions associated with the real vulnerability, to resolve the real vulnerability.

17. The non-transitory computer-readable medium of claim 15 , wherein the instructions, when executed by the hardware processor, further cause the processor to:

determine that the source code fingerprint corresponding to a third source code segment matches the source code fingerprint corresponding to the first source code segment, wherein the third source code segment is associated with a third plurality of vulnerability findings generated through SAST of the third source code segment; and

in response to determining that the source code fingerprint corresponding to the third source code segment matches the source code fingerprint corresponding to the first source code segment:

determine that the third plurality of vulnerability findings does not match the first plurality of vulnerability findings; and

in response to determining that the third plurality of vulnerability findings does not match the first plurality of vulnerability findings, transmit an alert to a device of an administrator, the alert indicating that the SAST of the first source code segment and the SAST of the third source code segment produced inconsistent results.

18. The non-transitory computer-readable medium of claim 15 , wherein the instructions, when executed by the hardware processor, further cause the processor to:

determine that the source code fingerprint corresponding to a third source code segment does not match any other source code fingerprints of the plurality of source code fingerprints, wherein the third source code segment is associated with a third plurality of vulnerability findings generated through SAST of the third source code segment; and

in response to determining that the source code fingerprint corresponding to the third source code segment does not match any of the other source code fingerprints of the plurality of source code fingerprints, transmit the third plurality of vulnerability findings to an external system for external review.

19. The non-transitory computer-readable medium of claim 15 , wherein the first plurality of vulnerability findings for the first source code segment comprises at least one of:

a buffer overflow vulnerability;

an SQL injection vulnerability; and

a cross-site scripting vulnerability.

20. The non-transitory computer-readable medium of claim 15 , wherein the instructions, when executed by the hardware processor, further cause the processor to:

determine that the source code fingerprint corresponding to a third source code segment matches the source code fingerprint corresponding to the first source code segment, wherein the third source code segment is associated with a third plurality of vulnerability findings generated through SAST of the third source code segment; and

in response to determining that the source code fingerprint corresponding to the third source code segment matches the source code fingerprint corresponding to the first source code segment:

automatically classify a first vulnerability finding of the third plurality of vulnerability findings as the real vulnerability, in response to determining that the first vulnerability finding of the third plurality of vulnerability findings matches the first vulnerability finding of the first plurality of vulnerability findings; and

automatically classify a second vulnerability finding of the third plurality of vulnerability findings as the false positive, in response to determining that the second vulnerability finding of the third plurality of vulnerability findings matches the second vulnerability finding of the first plurality of vulnerability findings.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Nov 29, 2021
From: BISHOP, JACK LAWSON, III; HERRON, ANTHONY; HOUKPATI, YAO; GATES, CARRIE E.
To: BANK OF AMERICA CORPORATION
Reel/Frame 058230/0394 →
Continuity (1)
Related Publication 20230169177A1 · Jun 1, 2023