# US 2025/0047704 A1 · Method, system, and computer program product for automatically mitigating vulnerabilities in source code

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2025/0047704 A1
- Document ID: US20250047704A1
- Status: Published application
- Kind: A1
- Application number: 18/920,974
- Filed: 2024-10-20
- Published: 2025-02-06
- Earliest claimed: 2013-05-29
- Assignees: Lucent Sky Corporation
- Applicants: Lucent Sky Corporation
- Inventors: Jim Liu; Yi-Chia Huang
- Web page: https://patentgrep.com/patent/US20250047704A1

## CPC

- G06F 8/443: {Optimisation}
- G06F 21/577: {Assessing vulnerabilities and evaluating computer system security}
- G06F 21/53: by executing in a restricted environment, e.g. sandbox or secure virtual machine
- G06F 21/554: {involving event detection and direct action}
- G06F 21/563: {by source code analysis}
- G06N 20/00: Machine learning
- H04L 63/14: {for detecting or protecting against malicious traffic}
- H04L 63/1425: {Traffic logging, e.g. anomaly detection}
- H04L 63/1433: {Vulnerability analysis}
- H04L 63/1466: {Active attacks involving interception, injection, modification, spoofing of data unit addresses, e.g. hijacking, packet injection or TCP sequence number attacks}
- G06F 21/6245: {Protecting personal data, e.g. for financial or medical purposes}
- G06F 2221/033: Test or assess software
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)
- G06N: COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- H04L: TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION (arrangements common to telegraphic and telephonic communication H04M)

## Abstract

A method, a system, and a computer program product for automatically mitigating vulnerabilities in a source code are provided. The method includes the following steps. First, a path graph is built according to the source code, where the path graph includes at least one path, and each of the at least one path includes multiple nodes. A tainted path is identified from the path graph, where the tainted path corresponds to at least one vulnerability. Multiple candidate nodes are located from the tainted path based on an existence of a tainted object. A confidence score of a first instant-fix call respectively corresponds to each of the candidate nodes is determined, and a candidate node having a maximum confidence score among the candidate nodes is set as a target node. The at least one vulnerability in the target node is mitigated automatically by applying the first instant-fix call.

## Claims

### Claim 1

A method for automatically mitigating vulnerabilities in a source code of an application comprising:
building a path graph according to the source code, wherein the path graph comprises at least one path, and wherein each of the at least one path comprises a plurality of nodes;
identifying a tainted path from the path graph, wherein the tainted path corresponds to at least one vulnerability;
locating a plurality of candidate nodes from the tainted path based on an existence of a tainted object;
determining a confidence score of a first instant-fix call respectively corresponds to each of the plurality of candidate nodes and setting a candidate node having a maximum confidence score among the plurality of candidate nodes as a target node; and
mitigating the at least one vulnerability in the target node automatically by applying the first instant-fix call.

### Claim 2 (depends on 1)

The method according to claim 1 further comprising:
in response to two or more candidate nodes having the same maximum confidence score among the plurality of candidate nodes, setting a candidate node having the maximum confidence score and being closest to a sink of the tainted path among the two or more candidate nodes as the target node.

### Claim 3 (depends on 1)

The method according to claim 1 further comprising:
determining another confidence score of a second instant-fix call respectively corresponds to each of the plurality of candidate nodes; and
comparing the confidence scores of the first instant-fix call and the another confidence scores of the second instant-fix call corresponding to all the plurality of candidate nodes, wherein the target node is a candidate node among the plurality of candidates nodes that the first instant-fix call is applied to and that has a maximum score among the confidence scores and the another confidence scores.

### Claim 4 (depends on 1)

The method according to claim 1, wherein the confidence score of the first instant-fix call respectively corresponds to each of the plurality of candidate nodes is assigned based on whether the at least one vulnerability is one of SQL injection, OS command injection, LDAP injection, XML injection, or XPath injection.

### Claim 5 (depends on 4)

The method according to claim 4, wherein the confidence of the first instant-fix call respectively corresponds to each of the plurality of candidate nodes is further assigned based on whether the at least one vulnerability contains predetermined string constants.

### Claim 6 (depends on 1)

The method according to claim 1, wherein the confidence score of the first instant-fix call respectively corresponds to each of the plurality of candidate nodes is assigned based on whether the at least one vulnerability contains predetermined functions.

### Claim 7 (depends on 1)

The method according to claim 1, wherein a zero confidence score of the first instant-fix call corresponds to any of the plurality of candidate nodes results in a compiler error of the source code.

### Claim 8 (depends on 1)

The method according to claim 1, wherein the maximum confidence score is higher than a preset non-zero value.

### Claim 9 (depends on 1)

The method according to claim 1 further comprising:
in response to the maximum confidence score not being higher than a preset non-zero value, request a user to permit to set the candidate node having the maximum confidence score as the target node before applying the first instant-fix call to the target node.

### Claim 10 (depends on 1)

The method according to claim 1 further comprising:
setting another candidate node among the plurality of candidate nodes according to a model trained based on a user's history data to replace the candidate node having the maximum confidence score as the target node.

### Claim 11 (depends on 1)

The method according to claim 1 further comprising:
setting another candidate node among the plurality of candidate nodes according to a model trained based on data from a plurality of users to replace the candidate node having the maximum confidence score as the target node.

### Claim 12

A computer system comprising:
a memory;
a processor, coupled to the memory and configured to:
build a path graph according to the source code, wherein the path graph comprises at least one path, and wherein each of the at least one path comprises a plurality of nodes;
identify a tainted path from the path graph, wherein the tainted path corresponds to at least one vulnerability;
locate a plurality of candidate nodes from the tainted path based on an existence of a tainted object;
determine a confidence score of a first instant-fix call respectively corresponds to each of the candidate nodes and set a candidate node having a maximum confidence score among the plurality of candidate nodes as a target node; and
mitigate the at least one vulnerability in the target node automatically by applying the first instant-fix call.

### Claim 13

A non-transitory computer-readable medium comprising a plurality of program instructions, which when executed by a computer system, cause the computer system to execute steps of:
building a path graph according to the source code, wherein the path graph comprises at least one path, and wherein each of the at least one path comprises a plurality of nodes;
identifying a tainted path from the path graph, wherein the tainted path corresponds to at least one vulnerability;
locating a plurality of candidate nodes from the tainted path based on an existence of a tainted object;
determining a confidence score of a first instant-fix call respectively corresponds to each of the candidate nodes and setting a candidate node having a maximum confidence score among the plurality of candidate nodes as a target node; and
mitigating the at least one vulnerability in the target node automatically by applying the first instant-fix call.
