# US 2023/0267203 A1 · Query generalization for prevention of injection attacks

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

- Number: US 2023/0267203 A1
- Document ID: US20230267203A1
- Status: Published application
- Kind: A1
- Application number: 17/677,675
- Filed: 2022-02-22
- Published: 2023-08-24
- Earliest claimed: 2022-02-22
- Assignees: Oracle International Corporation
- Applicants: Oracle International Corporation
- Inventors: Kostyantyn Vorobyov; Padmanabhan Krishnan
- Web page: https://patentgrep.com/patent/US20230267203A1

## CPC

- G06F 21/566: {Dynamic detection, i.e. detection performed at run-time, e.g. emulation, suspicious activities}
- G06F 2221/034: Test or assess a computer or a system
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A method for generating a query filter list includes obtaining set of training queries, each training query comprising a predicate and one or more accessed columns returned from evaluating the predicate, and transforming the set of training queries into a structure. The structure relates, for an accessed column and a training query, the predicate and a correlation value to the accessed column. The method further includes normalizing the structure into a normalized structure. The normalized structure grouping entries in the structure according to accessed column. The method further includes generating a generalized query from the normalized structure, and adding the generalized query to the query filter list.

## Claims

### Claim 1

A method for generating a query filter list, comprising:
obtaining set of training queries, each training query comprising a predicate and one or more accessed columns returned from evaluating the predicate;
transforming the set of training queries into a structure, the structure relating, for an accessed column and a training query, the predicate and a correlation value to the accessed column;
normalizing the structure into a normalized structure, the normalized structure grouping entries in the structure according to accessed column;
generating a generalized query from the normalized structure; and
adding the generalized query to the query filter list.

### Claim 2 (depends on 1)

The method of claim 1, wherein generating the generalized query comprises:
generalizing at least one entry in the normalized structured to create a generalized structure, and
generating the generalized query from the generalized structure.

### Claim 3 (depends on 1)

The method of claim 1, wherein generating the generalized query comprises:
determining that a threshold portion of columns of a table are accessed columns in the normalized structure, and
changing a plurality of accessed column identifiers in the table to a generic table identifier.

### Claim 4 (depends on 1)

The method of claim 1, wherein generating the generalized query comprises:
performing predicate generalization of at least one predicate in the normalized structure.

### Claim 5 (depends on 1)

The method of claim 1, further comprising:
receiving a target query;
comparing the target query to the generalized query in the query filter list to obtain a comparison result; and
making a determination whether to execute the target query based on the comparison result.

### Claim 6 (depends on 5)

The method of claim 5, wherein comparing the target query to the generalized query comprises at least one selected from a group consisting of:
determining that a target accessed column in the target query is not a subset of the plurality of accessed columns in the generalized query,
determining that the target accessed column is not a subset of the plurality of accessed columns, and
determining that a target predicate fails to imply the generalized predicate.

### Claim 7 (depends on 1)

The method of claim 1, further comprising:
determining a group of accessed columns that are accessed in the training query; and
adding the group of accessed columns as a correlation value for the accessed column.

### Claim 8 (depends on 1)

The method of claim 1, wherein normalizing the structure into the normalized structure comprises:
grouping a subset of entries in the structure that are for the same accessed column by generating a disjunction of predicates in the subset of entries, and
relating the disjunction to the accessed column in the normalized structure.

### Claim 9 (depends on 1)

The method of claim 1, wherein generating a generalized query comprises:
generating entries in the normalized structure to create a plurality of generalized entries;
generating a union of sub-queries, each sub-query corresponding to a generalized entry of the normalized structure; and
generating the generalized query from the union.

### Claim 10

A system, comprising:
a query analyzer repository configured to store:
a query filter list comprising a generalized query, and
a set of training queries, each training query comprising a predicate and one or more accessed columns returned from evaluating the predicate;
a computer processor; and
a query filter list generator executing on the computer processor configured to:
transform the set of training queries into a structure, the structure relating individually, for an accessed column and a training query, the predicate and a correlation value to the accessed column,
normalize the structure into a normalized structure, the normalized structure grouping entries in the structure according to accessed column,
generate a generalized query from the normalized structure, and
add the generalized query to a query filter list.

### Claim 11 (depends on 10)

The system of claim 10, further comprising:
a generalized structure comprising at least one entry in the normalized structured to create a generalized structure, and
wherein the generalized query is generated from the generalized structure.

### Claim 12 (depends on 10)

The system of claim 10, wherein the query analyzer repository comprises:
a threshold number, representing a portion of columns of a table that are accessed columns in the normalized structure to change a plurality of accessed column identifiers in the table to a generic table identifier.

### Claim 13 (depends on 12)

The system of claim 12, wherein the threshold number is a percentage.

### Claim 14 (depends on 10)

The system of claim 10, further comprising:
a query filter configured to:
receive a target query,
compare the target query to the generalized query in the query filter list to obtain a comparison result, and
make a determination whether to execute the target query based on the comparison result.

### Claim 15 (depends on 14)

The system of claim 14, wherein comparing the target query to the generalized query comprises at least one selected from a group consisting of:
determining that a target accessed column in the target query is not a subset of a permitted accessed column in the generalized query,
determining that a target accessed column is not a subset of the plurality of permitted accessed columns, and
determining that the target predicate fails to imply the permitted predicate.

### Claim 16

A method, comprising:
receiving a target query;
comparing the target query to a generalized query in a query filter list to obtain a comparison result, wherein the query filter list is generated by generalizing a set of training queries into the generalized query; and
making a determination whether to execute the target query based on the comparison result.

### Claim 17 (depends on 16)

The method of claim 16, wherein comparing the target query to the generalized query comprises at least one selected from a group consisting of:
determining that a target accessed column in the target query is not a subset of a permitted accessed column in the generalized query,
determining that a target accessed column is not a subset of the plurality of permitted accessed columns, and
determining that the target predicate fails to imply the permitted predicate.

### Claim 18 (depends on 16)

The method of claim 16, wherein generating the query filter list comprises:
obtaining set of training queries, each training query comprising a predicate and one or more accessed columns returned from evaluating the predicate;
transforming the set of training queries into a structure, the structure relating individually, for an accessed column and a training query, the predicate and a correlation value to the accessed column;
normalizing the structure into a normalized structure, the normalized structure grouping entries in the structure according to accessed column;
generating a generalized query from the normalized structure; and
adding the generalized query to the query filter list.

### Claim 19 (depends on 18)

The method of claim 18, wherein generating the generalized query comprises:
generalizing at least one entry in the normalized structured to create a generalized structure, and
generating the generalized query from the generalized structure.

### Claim 20 (depends on 18)

The method of claim 18, wherein generating the generalized query comprises:
determining that a threshold portion of columns of a table are accessed columns in the normalized structure, and
changing a plurality of accessed column identifiers in the table to a generic table identifier.
