# US 2025/0094576 A1 · Automatic detection of deserialization attacks with markov chains

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

- Number: US 2025/0094576 A1
- Document ID: US20250094576A1
- Status: Published application
- Kind: A1
- Application number: 18/898,654
- Filed: 2024-09-26
- Published: 2025-03-20
- Earliest claimed: 2021-10-29
- Assignees: Oracle International Corporation
- Applicants: Oracle International Corporation
- Inventors: Francois Gauthier; Sora Bae
- Web page: https://patentgrep.com/patent/US20250094576A1

## CPC

- 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}
- G06N 3/045: Combinations of networks
- G06N 3/08: Learning methods
- G06N 7/01: Probabilistic graphical models, e.g. probabilistic networks
- G06N 20/00: Machine learning
- G06F 2221/034: Test or assess a computer or a system
- G06N 20/10: using kernel methods, e.g. support vector machines [SVM]
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)
- G06N: COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS

## Abstract

A method for detecting a deserialization attack may include identifying, in a byte stream, a class name corresponding to a class, generating, for the class, a feature vector, generating, by applying a benign deserialization model to the feature vector, a benign probability window, generating, by applying a malicious deserialization model to the feature vector, a malicious probability window, comparing the benign probability window and the malicious probability window to obtain a comparison result, and determining, based on the comparison result, that the class is malicious.

## Claims

### Claim 1

A method for detecting a deserialization attack, comprising:
identifying, in a byte stream, a first class name corresponding to a first class;
generating, for the first class, a first feature vector;
generating, by applying a benign deserialization model to the first feature vector, a first benign confidence interval of a probability that the first class is benign, wherein the benign deserialization model comprises a Markov chain comprising a set of states and a set of probabilities of transitioning between two states in the set of states at a corresponding timestep;
generating, by applying a malicious deserialization model to the first feature vector, a first malicious confidence interval of a probability that the first class is malicious;
comparing the first benign confidence interval and the first malicious confidence interval to obtain a first comparison result, wherein comparing the first benign confidence interval and the first malicious confidence interval comprises determining whether the first benign confidence interval and the first malicious confidence interval overlap; and
determining, based on the first comparison result, that the first class is malicious.

### Claim 2 (depends on 1)

The method of claim 1, wherein the benign deserialization model comprises a plurality of Markov chains models comprising the Markov chain, and wherein applying the benign deserialization model comprises:
for each of at least a subset of the plurality of Markov chain models to generate a plurality of probabilities:
calculating a respective probability, in the plurality of probabilities, that the respective Markov chain model generated the first feature vector, and
determining the first benign confidence interval from the plurality of probabilities.

### Claim 3 (depends on 1)

The method of claim 1, further comprising:
in response to determining that the first class is malicious, preventing deserialization of the first class.

### Claim 4 (depends on 1)

The method of claim 1, wherein generating the first malicious confidence interval comprises:
generating, for the first feature vector, a plurality of probabilities, and
calculating, for the plurality of probabilities, a mean and a standard deviation.

### Claim 5 (depends on 1)

The method of claim 1, further comprising:
determining that the first benign confidence interval and the first malicious confidence interval overlap;
identifying, in the byte stream and following the first class name, a second class name corresponding to a second class;
generating, for the second class, a second feature vector;
generating, by applying the benign deserialization model to the second feature vector, a second benign confidence interval;
generating, by applying the malicious deserialization model to the second feature vector, a second malicious confidence interval;
comparing the second benign confidence interval and the second malicious confidence interval to obtain a second comparison result; and
determining, based on the second comparison result, that the second class is malicious.

### Claim 6 (depends on 1)

The method of claim 1, further comprising training the malicious deserialization model by:
deserializing a plurality of malicious deserialization examples to obtain a plurality of training sequences of class names,
obtaining, for the plurality of training sequences of class names, a plurality of training feature vectors, and
generating a plurality of transitional probability matrices by applying Bayesian inference to the plurality of training feature vectors.

### Claim 7 (depends on 6)

The method of claim 6, wherein each of the transitional probability matrices comprises a plurality of rows, the method further comprising:
modeling the plurality of rows as a plurality of Dirichlet distributions.

### Claim 8

A system for detecting a deserialization attack, comprising:
a repository configured to store:
a first class corresponding to a first feature vector, and
a byte stream comprising a first class name corresponding to the first class;
a computer processor and a memory;
a feature generator executing on the computer processor and using the memory, wherein the feature generator is configured to generate, for the first class, the first feature vector; and
a deserialization manager executing on the computer processor and using the memory, wherein the deserialization manager is configured to:
identify, in the byte stream, the first class name,
generate, by applying a malicious deserialization model to the first feature vector, a first malicious confidence interval of a probability that the first class is malicious,
generate, by applying a benign deserialization model to the first feature vector, a first benign confidence interval of a probability that the first class is benign, wherein the benign deserialization model comprises a Markov chain comprising a set of states and a set of probabilities of transitioning between two states in the set of states at a corresponding timestep,
compare the first benign confidence interval and the first malicious confidence interval to obtain a first comparison result, wherein comparing the first benign confidence interval and the first malicious confidence interval comprises determining whether the first benign confidence interval and the first malicious confidence interval overlap, and
determine, based on the first comparison result, that the first class is malicious.

### Claim 9 (depends on 8)

The system of claim 8, wherein the benign deserialization model comprises a plurality of Markov chains comprising the Markov chain models, and wherein applying the benign deserialization model comprises:
for each of at least a subset of the plurality of Markov chain models to generate a plurality of probabilities:
calculating a respective probability, in the plurality of probabilities, that the respective Markov chain model generated the first feature vector, and
determining the first benign confidence interval from the plurality of probabilities.

### Claim 10 (depends on 8)

The system of claim 8, wherein the deserialization manager is further configured to:
in response to determining that the first class is malicious, prevent deserialization of the first class.

### Claim 11 (depends on 8)

The system of claim 8, wherein the deserialization manager is further configured to generate the first malicious confidence interval by:
generating, for the first feature vector, a plurality of probabilities, and
calculating, for the plurality of probabilities, a mean and a standard deviation.

### Claim 12 (depends on 8)

The system of claim 8, wherein the deserialization manager is further configured to:
determine that the first benign confidence interval and the first malicious confidence interval overlap,
identify, in the byte stream and following the first class name, a second class name corresponding to a second class,
generate, by applying the benign deserialization model to a second feature vector, a second benign confidence interval,
generate, by applying the malicious deserialization model to the second feature vector, a second malicious confidence interval,
compare the second benign confidence interval and the second malicious confidence interval to obtain a second comparison result, and
determine, based on the second comparison result, that the second class is malicious,
wherein the feature generator is further configured to generate, for the second class, the second feature vector.

### Claim 13 (depends on 8)

The system of claim 8, further comprising a deserialization model trainer executing on the computer processor and using the memory, wherein the deserialization model trainer is configured to train the malicious deserialization model by:
deserializing a plurality of malicious deserialization examples to obtain a plurality of training sequences of class names,
obtaining, for the plurality of training sequences of class names, a plurality of training feature vectors, and
generating a plurality of transitional probability matrices by applying Bayesian inference to the plurality of training feature vectors.

### Claim 14 (depends on 13)

The system of claim 13, wherein each of the transitional probability matrices comprises a plurality of rows, and wherein the deserialization model trainer is further configured to:
model the plurality of rows as a plurality of Dirichlet distributions.

### Claim 15

A method for detecting a deserialization attack, comprising:
sending a byte stream to a deserialization manager configured to perform:
identifying, in the byte stream, a first class name corresponding to a first class,
generating, for the first class, a first feature vector,
generating, by applying a benign deserialization model to the first feature vector, a first benign confidence interval of a probability that the first class is benign, wherein the benign deserialization model comprises a Markov chain comprising a set of states and a set of probabilities of transitioning between two states in the set of states at a corresponding timestep,
generating, by applying a malicious deserialization model to the first feature vector, a first malicious confidence interval of a probability that the first class is malicious,
comparing the first benign confidence interval and the first malicious confidence interval to obtain a first comparison result, wherein comparing the first benign confidence interval and the first malicious confidence interval comprises determining whether the first benign confidence interval and the first malicious confidence interval overlap,
making a first determination, based on the first comparison result, that the first class is malicious, and
transmitting the first determination that the first class is malicious; and
receiving, from the deserialization manager, the first determination that the first class is malicious.

### Claim 16 (depends on 15)

The method of claim 15, wherein the deserialization manager is further configured to perform:
in response to determining that the first class is malicious, preventing deserialization of the first class.

### Claim 17 (depends on 15)

The method of claim 15, wherein the deserialization manager is further configured to generate the first malicious confidence interval by:
generating, for the first feature vector, a plurality of probabilities; and
calculating, for the plurality of probabilities, a mean and a standard deviation.

### Claim 18 (depends on 15)

The method of claim 15, wherein the deserialization manager is further configured to perform:
determining that the first benign confidence interval and the first malicious confidence interval overlap;
identifying, in the byte stream and following the first class name, a second class name corresponding to a second class;
generating, for the second class, a second feature vector;
generating, by applying the benign deserialization model to the second feature vector, a second benign confidence interval;
generating, by applying the malicious deserialization model to the second feature vector, a second malicious confidence interval;
comparing the second benign confidence interval and the second malicious confidence interval to obtain a second comparison result; and
determining, based on the second comparison result, that the second class is malicious.

### Claim 19 (depends on 15)

The method of claim 15, wherein the benign deserialization model comprises a plurality of Markov chains comprising the Markov chain models, and wherein applying the benign deserialization model comprises:
for each of at least a subset of the plurality of Markov chain models to generate a a plurality of probabilities:
calculating a respective probability, in the plurality of probabilities, that the respective Markov chain model generated the first feature vector, and
determining the first benign confidence interval from the plurality of probabilities.

### Claim 20 (depends on 15)

The method of claim 15, wherein the deserialization manager is further configured to train the malicious deserialization model by:
deserializing a plurality of malicious deserialization examples to obtain a plurality of training sequences of class names;
obtaining, for the plurality of training sequences of class names, a plurality of training feature vectors; and
generating a plurality of transitional probability matrices by applying Bayesian inference to the plurality of training feature vectors.
