IP Library Granted Patent US 12,443,579
Granted Patent B1
US 12,443,579 · App. 18/082,559 · Granted Oct 14, 2025

Secure query processing

Inventors: Andrei Paduroiu (Bellevue, WA); Yaron Burd (Bellevue, WA)
Assignee: Amazon Technologies, Inc.
G06F16/2246G06F16/245
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 12,443,579
App. No.
18/082,559
Granted
Oct 14, 2025
Kind
B1
Abstract

A distributed database keeps an abstract syntax tree (AST) and an included user code from interacting with a query engine coordinator during the performance of query execution processes. The query engine coordinator is separated into a frontend and backend, where a compiler on the frontend generates an AST and serializes it to be sent to the backend. The backend is implemented in a security environment separate from the front end. The backend deserializes the AST, sanitizes it, and generates a query plan based on the sanitized AST.

Claims (52)

1. A system, comprising:

one or more computing devices comprising at least one processor and at least one memory that stores computer-executable instructions that, in response to execution by the at least one processor, cause the system to at least:

receive a query at a query coordinator;

generate, by a frontend of the query coordinator, a first abstract syntax tree (AST) based, at least in part, on the query;

serialize, by the frontend of the query coordinator, data that represents the first AST;

generate, by a backend of the query coordinator, a second AST based, at least in part, on the serialized data;

evaluate, by a sanitizer of the backend of the query coordinator, the second AST for a security risk by at least enforcing one or more security rules;

generate, by the backend of the query coordinator, a third AST that is a modified version of the second AST in which the security risk is mitigated; and

cause a query plan based, at least in part, on the third AST to be executed by a query engine executor sandboxed from the frontend and the backend of the query coordinator.

2. The system of claim 1 , wherein the frontend of the query coordinator is in a security domain separate from the backend of the query coordinator.

3. The system of claim 1 , wherein an object header is generated to comprise the serialized data that represents the first AST and indicates that a node of the first AST has been at least one of previously serialized, is a stateful object, or is a new object.

4. The system of claim 1 , wherein:

the query coordinator comprises two instances of shared state information;

the first AST is based, at least in part, on one instance of the two instances; and

the second AST is based, at least in part, on another instance of the two instances.

5. The system of claim 1 , wherein the second AST is based, at least in part, on a previously serialized AST when an identifier representing the first AST is matched to an identifier stored in memory.

6. A computer-implemented method of processing a query of a database, comprising:

receiving a query at a query coordinator;

generating, by a frontend of the query coordinator, a first abstract syntax tree (AST) based, at least in part, on the query;

serialize, by the frontend of the query coordinator, the first AST;

transmitting the serialized first AST to a backend of the query coordinator;

generating, by the backend of the query coordinator, a second AST based at least on the serialized first AST;

evaluate, by a sanitizer of the backend of the query coordinator, the second AST for a security risk by at least enforcing one or more security rules; and

cause a query plan based at least on the second AST to be executed by a query engine executor sandboxed from the frontend and the backend of the query coordinator.

7. The computer-implemented method of claim 6 , wherein the frontend of the query coordinator is in a security domain separate from the backend of the query coordinator.

8. The computer-implemented method of claim 6 , wherein serializing the first AST comprises generating an identifier for at least one node of the first AST.

9. The computer-implemented method of claim 6 , wherein serializing the first AST includes shared state information as an input.

10. The computer-implemented method of claim 6 , wherein generating the second AST is based on shared state information of a backend of the query coordinator that is identical to shared state information of a frontend of the query coordinator.

11. The computer-implemented method of claim 6 , wherein:

generating the second AST is based on retrieving at least one of its nodes stored in memory.

12. The computer-implemented method of claim 6 , wherein:

generating the second AST is based, at least in part, on determining that a node of the first AST has previously been serialized.

13. The computer-implemented method of claim 6 , wherein a third AST is generated based, at least in part, on identifying and mitigating the security risk identified in the second AST.

14. A non-transitory computer-readable storage medium storing thereon executable instructions that, as a result of being executed by one or more processors of a computer system, cause the computer system to at least:

generate a first abstract syntax tree (AST) based, at least in part, on a user program;

serialize data that represents the first AST;

send the serialized data from a frontend of a query coordinator to a backend of a query coordinator, wherein the backend of the query coordinator:

is in a security domain separate from the frontend of the query coordinator,

generates a second AST based at least on the first AST,

evaluates, by using a sanitizer of the backend of the query coordinator, the second AST for a security risk by at least enforcing one or more security rules, and

generates a query plan based, at least in part, on the second AST; and

cause the query plan to be executed by a query engine sandboxed from the frontend and the backend of the query coordinator.

15. The non-transitory computer-readable storage medium of claim 14 , comprising further instructions that, as a result of being executed by the one or more processors, cause the computer system to:

identify the security risk in the second AST; and

generate a third AST that is a modified version of the second AST in which the security risk is mitigated.

16. The non-transitory computer-readable storage medium of claim 14 , wherein the first AST is generated in the frontend of the query coordinator in the security domain separate from the backend of the query coordinator.

17. The non-transitory computer-readable storage medium of claim 14 , wherein:

the query coordinator comprises two instances of identical shared state information.

18. The non-transitory computer-readable storage medium of claim 14 , wherein the query plan is based, at least in part, on a third AST that is a modified version of the second AST.

19. The non-transitory computer-readable storage medium of claim 14 storing thereon further executable instructions that, as a result of being executed by the one or more processors of the computer system, cause the computer system to at least:

serialize the first AST based, at least in part, on a search in a cache for an indicator of at least one node of the first AST.

20. The non-transitory computer-readable storage medium of claim 14 , wherein the serialized data comprises a serialized function.

Assignments (2)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Jan 13, 2025
From: PADUROIU, ANDREI
To: AMAZON TECHNOLOGIES, INC.
Reel/Frame 069847/0175 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Dec 16, 2022
From: BURD, YARON
To: AMAZON TECHNOLOGIES, INC.
Reel/Frame 062119/0911 →
References Cited (34)
US 7984043B1 · Waas · 2011 [cited by applicant]
US 10289723B1 · Cai et al. · 2019 [cited by applicant]
US 11216454B1 · Cole et al. · 2022 [cited by applicant]
US 11379480B1 · Breßet al. · 2022 [cited by applicant]
US 11620118B2 · Schneuwly · 2023 [cited by examiner]
US 11886582B1 · Abdallah · 2024 [cited by examiner]
US 20080071785A1 · Kabra et al. · 2008 [cited by applicant]
US 20090112792A1 · Barsness et al. · 2009 [cited by applicant]
US 20120078951A1 · Hsu et al. · 2012 [cited by applicant]
US 20120191642A1 · George · 2012 [cited by applicant]
US 20120191690A1 · George · 2012 [cited by applicant]
US 20120317447A1 · Yildiz et al. · 2012 [cited by applicant]
US 20130191650A1 · Balakrishnan et al. · 2013 [cited by applicant]
US 20150379076A1 · Grosse et al. · 2015 [cited by applicant]
US 20170193054A1 · Tang et al. · 2017 [cited by applicant]
US 20180096166A1 · Rogers et al. · 2018 [cited by applicant]
US 20190207974A1 · Jas · 2019 [cited by examiner]
US 20200019722A1 · Li · 2020 [cited by examiner]
US 20200349163A1 · Nadeau et al. · 2020 [cited by applicant]
US 20200404007A1 · Singh · 2020 [cited by examiner]
US 20210374235A1 · Brossard et al. · 2021 [cited by applicant]
US 20220138195A1 · Cole et al. · 2022 [cited by applicant]
US 20220179626A1 · Kacherginsky · 2022 [cited by examiner]
US 20220374541A1 · Shigematsu et al. · 2022 [cited by applicant]
US 20230004669A1 · Langseth et al. · 2023 [cited by applicant]
US 20230112250A1 · Agrawal · 2023 [cited by examiner]
Yamaguchi, Fabian & Konrad Rieck, “Generalized Vulnerability Extrapolation using Abstract Syntax Trees”, ACM ACSAC'12 (2012), 11 pages. (Year: 2012). [cited by examiner]
Zhuo, Z., et al., “Long short-term memory on abstract syntax tree for SQL injection detection”, Wiley publishing, IET Software, (2021) vol. 15, pp. 188-197. (Year: 2021). [cited by examiner]
USPTO Non-Final Office Action dated Apr. 25, 2024, U.S. Appl. No. 17/953,038, 15 pages. [cited by applicant]
International Search Report and Written Opinion mailed Dec. 22, 2023, Patent Application No. PCT/US2023/075042, 15 pages. [cited by applicant]
USPTO Non-Final Office Action dated Nov. 8, 2023, U.S. Appl. No. 17/988,724, 13 pages. [cited by applicant]
Wikipedia, “User-defined Function,” Retrieved on Apr. 9, 2015 from http://en.wikipedia.org/w/index.php?ti tle=User-defined function&oldid=401094103, 4 pages. [cited by applicant]
Anonymous, “SQL Abstract Syntax Trees Vocabulary,” retrieved on Feb. 17, 2023 from http://ns.inria.fr/ast/sql/index.html, Jan. 28, 2014, 26 pages. [cited by applicant]
USPTO Non-Final Office Action dated Feb. 26, 2025, U.S. Appl. No. 17/953,038, 18 pages. [cited by applicant]