# US 2021/0232675 A1 · Stack pivot exploit detection and mitigation

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

- Number: US 2021/0232675 A1
- Document ID: US20210232675A1
- Status: Published application
- Kind: A1
- Application number: 17/228,478
- Filed: 2021-04-12
- Published: 2021-07-29
- Earliest claimed: 2018-04-13
- Assignees: Webroot Inc.
- Applicants: Webroot Inc.
- Inventors: Andrew Sandoval
- Web page: https://patentgrep.com/patent/US20210232675A1

## CPC

- G06F 21/52: during program execution, e.g. stack integrity {; Preventing unwanted data erasure; Buffer overflow}
- G06F 11/302: {where the computing system component is a software system}
- G06F 11/3688: {for test execution, e.g. scheduling of test suites}
- G06F 11/0754: {by exceeding limits}
- G06F 11/0793: {Remedial or corrective actions (recovery from an exception in an instruction pipeline G06F9/3861; by retry G06F11/1402; for recovering from a failure of a protocol instance or entity H04L69/40)}
- G06F 11/3466: {Performance evaluation by tracing or monitoring}
- G06F 2221/033: Test or assess software
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Examples of the present disclosure describe systems and methods for detecting and mitigating stack pivoting exploits. In aspects, various “checkpoints” may be identified in software code. At each checkpoint, the current stack pointer, stack base, and stack limit for each mode of execution may be obtained. The current stack pointer for each mode of execution may be evaluated to determine whether the stack pointer falls within a stack range between the stack base and the stack limit of the respective mode of execution. When the stack pointer is determined to be outside of the expected stack range, a stack pivot exploit is detected and one or more remedial actions may be automatically performed.

## Claims

### Claim 1

A system for stack pivot exploit detection and mitigation, comprising:
a processor; and
memory storing instructions that, when executed by the processor, causes the system to perform a set of operations for stack pivot detection and mitigation, the set of operations comprising:
defining, for a process executing in an execution mode, thread information for the process, the thread information comprising a current stack pointer, a stack base, and a stack limit, the stack base and the stack limit defining a stack memory range for the process;
based on the current stack pointer for the process executing in the execution mode, generating a corresponding stack base pointer for the stack base, and a corresponding stack limit pointer for the stack limit;
comparing the current stack pointer for the thread information to the stack base pointer and the stack limit pointer to determine whether the current stack pointer is within the stack memory range;
when the current stack pointer is determined to be within the stack memory range, permitting the process to execute; and
when the current stack pointer is determined to not be within the stack memory range, determining an occurrence of a stack pivot exploit and, in response, performing a remedial action.

### Claim 2 (depends on 1)

The system of claim 1, wherein the execution mode is at least one of: a kernel mode, a 32-bit mode, or a 64-bit mode.

### Claim 3 (depends on 2)

The system of claim 2, wherein the execution mode comprises: the kernel mode, the 32-bit mode, and the 64-bit mode, each execution mode having a thread information block storing thread information in a datasource

### Claim 4 (depends on 1)

The system of claim 1, wherein the remedial action comprises at least one of: generating notifications output to a user interface, terminating the process, modifying a set of user permissions associated with the process, and quarantining a file associated with the process.

### Claim 5 (depends on 1)

The system of claim 1, wherein comparing the current stack pointer for the thread information to the stack base pointer and the stack limit pointer to determine whether the current stack pointer is within the stack memory range comprises:
comparing a memory address for the current stack pointer to the stack memory range, the stack memory range comprising a range of memory addresses from the memory address for the stack base pointer and the memory address for the stack limit pointer to determine whether the memory address for the current stack pointer is within the range of memory addresses.

### Claim 6 (depends on 1)

The system of claim 1, further comprising:
executing a series of checkpoints over time, each checkpoint determining the occurrence of the stack pivot.

### Claim 7 (depends on 6)

The system of claim 6, wherein the execution mode comprises a kernel execution mode, a 32-bit execution mode, and a 64-bit execution mode, each execution mode having a corresponding series of checkpoints for determining the occurrence of a stack pivot within each execution mode.

### Claim 8

A method for stack pivot exploit detection and mitigation, comprising:
defining, for a process executing in an execution mode, thread information for the process, the thread information comprising a current stack pointer, a stack base, and a stack limit, the stack base and the stack limit defining a stack memory range for the process;
based on the current stack pointer for the process executing in the execution mode, generating a corresponding stack base pointer for the stack base, and a corresponding stack limit pointer for the stack limit;
comparing the current stack pointer for the thread information to the stack base pointer and the stack limit pointer to determine whether the current stack pointer is within the stack memory range;
when the current stack pointer is determined to be within the stack memory range, permitting the process to execute; and
when the current stack pointer is determined to not be within the stack memory range, determining an occurrence of a stack pivot exploit and, in response, performing a remedial action.

### Claim 9 (depends on 8)

The method of claim 8, wherein the execution mode is at least one of: a kernel mode, a 32-bit mode, or a 64-bit mode.

### Claim 10 (depends on 9)

The method of claim 9, wherein the execution mode comprises: the kernel mode, the 32-bit mode, and the 64-bit mode, each execution mode having a thread information block storing thread information in a datasource

### Claim 11 (depends on 8)

The method of claim 8, wherein the remedial action comprises at least one of:
generating notifications output to a user interface, terminating the process, modifying a set of user permissions associated with the process, and quarantining a file associated with the process.

### Claim 12 (depends on 8)

The method of claim 8, wherein comparing the current stack pointer for the thread information to the stack base pointer and the stack limit pointer to determine whether the current stack pointer is within the stack memory range comprises:
comparing a memory address for the current stack pointer to the stack memory range, the stack memory range comprising a range of memory addresses from the memory address for the stack base pointer and the memory address for the stack limit pointer to determine whether the memory address for the current stack pointer is within the range of memory addresses.

### Claim 13 (depends on 8)

The method of claim 8, further comprising:
executing a series of checkpoints over time, each checkpoint determining the occurrence of the stack pivot.

### Claim 14 (depends on 13)

The method of claim 13, wherein the execution mode comprises a kernel execution mode, a 32-bit execution mode, and a 64-bit execution mode, each execution mode having a corresponding series of checkpoints for determining the occurrence of a stack pivot within each execution mode.

### Claim 15

A computer storage device storing instructions that, when executed, are capable of performing a method for stack pivot exploit detection and mitigation, the method comprising:
defining, for a process executing in an execution mode, thread information for the process, the thread information comprising a current stack pointer, a stack base, and a stack limit, the stack base and the stack limit defining a stack memory range for the process;
based on the current stack pointer for the process executing in the execution mode, generating a corresponding stack base pointer for the stack base, and a corresponding stack limit pointer for the stack limit;
comparing the current stack pointer for the thread information to the stack base pointer and the stack limit pointer to determine whether the current stack pointer is within the stack memory range;
when the current stack pointer is determined to be within the stack memory range, permitting the process to execute; and
when the current stack pointer is determined to not be within the stack memory range, determining an occurrence of a stack pivot exploit and, in response, performing a remedial action.

### Claim 16 (depends on 15)

The computer storage device of claim 15, wherein the execution mode is at least one of: a kernel mode, a 32-bit mode, or a 64-bit mode.

### Claim 17 (depends on 16)

The computer storage device of claim 16, wherein the execution mode comprises: the kernel mode, the 32-bit mode, and the 64-bit mode, each execution mode having a thread information block storing thread information in a datasource

### Claim 18 (depends on 15)

The computer storage device claim 15, wherein the remedial action comprises at least one of: generating notifications output to a user interface, terminating the process, modifying a set of user permissions associated with the process, and quarantining a file associated with the process.

### Claim 19 (depends on 8)

The computer storage device of claim 8, further comprising:
executing a series of checkpoints over time, each checkpoint determining the occurrence of the stack pivot.

### Claim 20 (depends on 19)

The computer storage device of claim 19, wherein the execution mode comprises a kernel execution mode, a 32-bit execution mode, and a 64-bit execution mode, each execution mode having a corresponding series of checkpoints for determining the occurrence of a stack pivot within each execution mode.
