# US 2024/0202320 A1 · System and method for auto repairing vulnerable code program fragments of a software

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

- Number: US 2024/0202320 A1
- Document ID: US20240202320A1
- Status: Published application
- Kind: A1
- Application number: 18/530,300
- Filed: 2023-12-06
- Published: 2024-06-20
- Earliest claimed: 2022-12-16
- Assignees: Tata Consultancy Services Limited
- Applicants: Tata Consultancy Services Limited
- Inventors: KUMAR MANSUKHLAL VIDHANI; SANKET ACHAL SINHA; RAJAN MINDIGAL ALASINGARA BHATTACHAR; SACHIN PREMSUKH LODHA; MEENA SINGH DILIP THAKUR
- Web page: https://patentgrep.com/patent/US20240202320A1

## CPC

- G06F 21/54: by adding security routines or objects to programs
- G06F 21/57: Certifying or maintaining trusted computer platforms, e.g. secure boots or power-downs, version controls, system software checks, secure updates or assessing vulnerabilities
- G06F 8/436: {Semantic checking}
- G06F 8/53: Decompilation; Disassembly
- G06F 2221/033: Test or assess software
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

This disclosure provides system and method for auto repairing vulnerable code program fragments of a software. The present disclosure addresses problems of conventional approaches which are dependent on test cases. In the present disclosure, vulnerabilities in an input application are identified and repaired. First, a plurality of vulnerability detection rules is executed against an application in binary form (i.e., input application) and a plurality of vulnerable code fragments are identified. Post identification of the plurality of vulnerable code fragments, a mapping is created from the application in binary form to its source code files. Post mapping, paths capturing different application functionalities are extracted. Subsequently, a plurality of vulnerable source code program fragments is extracted and auto repair rules are applied on entire application functionality. As a result of execution of the auto repair rules, the plurality of vulnerable source code program fragments is replaced with safe code fragments.

## Claims

### Claim 1

A processor implemented method, comprising:
receiving, via an input/output interface, an application in binary form, and a set of predefined vulnerability detection rules as an input;
detecting, via a first module executed by one or more hardware processors, a plurality of vulnerable program fragments in the received application in binary form based on the set of predefined vulnerability detection rules;
creating, via a second module executed by the one or more hardware processors, a mapping between the application in binary form and a plurality of source code files corresponding to the application in binary form to identify a plurality of vulnerable source code program fragments; and
performing, via a third module executed by the one or more hardware processors, an auto repairing process on each of the identified plurality of vulnerable source code program fragments to obtain a plurality of safe source code program fragments, wherein the auto repairing process comprises:
extracting, one or more paths representing a functionality aspect of the application in binary form and a plurality of vulnerable program statements for each vulnerable source code program fragment from the plurality of vulnerable source code program fragments in the application in binary form based on the created mapping;
applying, a functional ordered auto repair rule from a plurality of functional ordered auto repair rules in accordance with a plurality of predefined criterions to each of the plurality of vulnerable program statements of each path from the one or more paths;
computing, an effect of applying the functional ordered auto repair rule on a plurality of non-vulnerable program statements within a first set of procedures from a set of procedures associated with each of the one or more paths, wherein the functional ordered auto repair rule utilizes one or more repair strategies, and wherein one or more inconsistencies are generated in the plurality of non-vulnerable program statements within the first set of procedures from the set of procedures associated with each of the one or more paths when the one or more repair strategies are used;
resolving, the one or more inconsistency generated in the plurality of non-vulnerable program statements within the first set of procedures from the set of procedures associated with each of the one or more paths; and
iteratively computing, an effect of use of the one or more repair strategies on a second set of the procedures from the set of procedures and resolving the one or more inconsistency generated in the second set of procedures from the set of procedures associated with each of the one or more paths.

### Claim 2 (depends on 1)

The processor implemented method of claim 1, wherein the functionality aspect is characterized by a functional group attribute and an order attribute.

### Claim 3 (depends on 1)

The processor implemented method of claim 1, wherein the plurality of predefined criterions include (i) determining type of each of the plurality of vulnerable program statements (ii) determining a functional ordered auto repair rule from the plurality of functional ordered auto repair rules matching to each of the plurality of vulnerable program statements, and (iii) determining a rule type of the functional ordered auto repair rule from the plurality of functional ordered auto repair rules matching to each of the plurality of vulnerable program statements.

### Claim 4 (depends on 1)

The processor implemented method of claim 1, wherein the first set of procedures represents a set of vulnerability located procedures.

### Claim 5 (depends on 1)

The processor implemented method of claim 1, wherein the second set of procedures represents a set of non-vulnerability located procedures.

### Claim 6 (depends on 1)

The processor implemented method of claim 1, wherein the one or more repair strategies are utilized based on the rule type of the functional ordered auto repair rule from the plurality of functional ordered auto repair rules matching to each of the plurality of vulnerable program statements.

### Claim 7

A system, comprising:
a memory storing instructions;
one or more communication interfaces; and
one or more hardware processors coupled to the memory via the one or more communication interfaces, wherein the one or more hardware processors are configured by the instructions to:
receive, an application in binary form and a set of predefined vulnerability detection rules as an input;
detect, a plurality of vulnerable program fragments in the received application in binary form based on the set of predefined vulnerability detection rules;
create, a mapping between the application in binary form and a plurality of source code files corresponding to the application in binary form to identify a plurality of vulnerable source code program fragments; and
perform, an auto repairing process on each of the identified plurality of vulnerable source code program fragments to obtain a plurality of safe source code program fragments, wherein the auto repairing process comprises:
extracting, one or more paths representing a functionality aspect of the application in binary form and a plurality of vulnerable program statements for each vulnerable source code program fragment from the plurality of vulnerable source code program fragments in the application in binary form based on the created mapping;
applying, a functional ordered auto repair rule from a plurality of functional ordered auto repair rules in accordance with a plurality of predefined criterions to each of the plurality of vulnerable program statements of each path from the one or more paths;
computing, an effect of applying the functional ordered auto repair rule on a plurality of non-vulnerable program statements within a first set of procedures from a set of procedures associated with each of the one or more paths, wherein the functional ordered auto repair rule utilizes one or more repair strategies, and wherein one or more inconsistencies are generated in the plurality of non-vulnerable program statements within the first set of procedures from the set of procedures associated with each of the one or more paths when the one or more repair strategies are used;
resolving, the one or more inconsistency generated in the plurality of non-vulnerable program statements within the first set of procedures from the set of procedures associated with each of the one or more paths; and
iteratively computing, an effect of use of the one or more repair strategies on a second set of the procedures from the set of procedures and resolving the one or more inconsistency generated in the second set of procedures from the set of procedures associated with each of the one or more paths.

### Claim 8 (depends on 7)

The system of claim 7, wherein the functionality aspect is characterized by a functional group attribute and an order attribute.

### Claim 9 (depends on 7)

The system of claim 7, wherein the plurality of predefined criterions include (i) determining type of each of the plurality of vulnerable program statements (ii) determining a functional ordered auto repair rule from the plurality of functional ordered auto repair rules matching to each of the plurality of vulnerable program statements, and (iii) determining a rule type of the functional ordered auto repair rule from the plurality of functional ordered auto repair rules matching to each of the plurality of vulnerable program statements.

### Claim 10 (depends on 7)

The system of claim 7, wherein the first set of procedures represents a set of vulnerability located procedures.

### Claim 11 (depends on 7)

The system of claim 7, wherein the second set of procedures represents a set of non-vulnerability located procedures.

### Claim 12 (depends on 7)

The system of claim 7, wherein the one or more repair strategies are utilized based on the rule type of the functional ordered auto repair rule from the plurality of functional ordered auto repair rules matching to each of the plurality of vulnerable program statements.

### Claim 13

One or more non-transitory machine-readable information storage mediums comprising one or more instructions which when executed by one or more hardware processors cause:
receiving an application in binary form, and a set of predefined vulnerability detection rules as an input;
detecting a plurality of vulnerable program fragments in the received application in binary form based on the set of predefined vulnerability detection rules;
creating a mapping between the application in binary form and a plurality of source code files corresponding to the application in binary form to identify a plurality of vulnerable source code program fragments; and
performing an auto repairing process on each of the identified plurality of vulnerable source code program fragments to obtain a plurality of safe source code program fragments, wherein the auto repairing process comprises:
extracting one or more paths representing a functionality aspect of the application in binary form and a plurality of vulnerable program statements for each vulnerable source code program fragment from the plurality of vulnerable source code program fragments in the application in binary form based on the created mapping;
applying a functional ordered auto repair rule from a plurality of functional ordered auto repair rules in accordance with a plurality of predefined criterions to each of the plurality of vulnerable program statements of each path from the one or more paths;
computing an effect of applying the functional ordered auto repair rule on a plurality of non-vulnerable program statements within a first set of procedures from a set of procedures associated with each of the one or more paths, wherein the functional ordered auto repair rule utilizes one or more repair strategies, and wherein one or more inconsistencies are generated in the plurality of non-vulnerable program statements within the first set of procedures from the set of procedures associated with each of the one or more paths when the one or more repair strategies are used;
resolving the one or more inconsistency generated in the plurality of non-vulnerable program statements within the first set of procedures from the set of procedures associated with each of the one or more paths; and
iteratively computing an effect of use of the one or more repair strategies on a second set of the procedures from the set of procedures and resolving the one or more inconsistency generated in the second set of procedures from the set of procedures associated with each of the one or more paths.

### Claim 14 (depends on 13)

The one or more non-transitory machine readable information storage mediums of claim 13, wherein the functionality aspect is characterized by a functional group attribute and an order attribute.

### Claim 15 (depends on 13)

The one or more non-transitory machine readable information storage mediums of claim 13, wherein the plurality of predefined criterions include (i) determining type of each of the plurality of vulnerable program statements (ii) determining a functional ordered auto repair rule from the plurality of functional ordered auto repair rules matching to each of the plurality of vulnerable program statements, and (iii) determining a rule type of the functional ordered auto repair rule from the plurality of functional ordered auto repair rules matching to each of the plurality of vulnerable program statements.
