From caba6769495cc22752326b7e09eebdb99cef6b39 Mon Sep 17 00:00:00 2001 From: Michael Hohn Date: Wed, 4 Jun 2025 12:05:23 -0700 Subject: [PATCH] session.ql: from-where-select --- session.ql | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 session.ql diff --git a/session.ql b/session.ql new file mode 100644 index 0000000..6d39e85 --- /dev/null +++ b/session.ql @@ -0,0 +1,35 @@ +import cpp + +// from Call cl +// select cl + + +/* + +int get_new_id() { + int id = getpid(); + return id; +} +*/ + +// Goal: Find connection + +// 1. reading user data -- source +// count = read(STDIN_FILENO, buf, BUFSIZE - 1); +// ^^^ +// from FunctionCall read, Expr buf +// where read.getTarget().getName() = "read" +// and buf = read.getArgument(1) +// select read, buf + + +// 2. writing sql -- sink +// rc = sqlite3_exec(db, query, NULL, 0, &zErrMsg); +// ^^^^^ +// from FunctionCall exec, Expr query +// where exec.getTarget().getName() = "sqlite3_exec" +// and query = exec.getArgument(1) +// select exec, query + + +// 3. find call path between 1 and 2 them \ No newline at end of file