File tree Expand file tree Collapse file tree 4 files changed +23
-1
lines changed
test/query-tests/Security/CWE-1427-PromptInjection Expand file tree Collapse file tree 4 files changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -54,6 +54,7 @@ private import semmle.python.frameworks.Multidict
5454private import semmle.python.frameworks.Mysql
5555private import semmle.python.frameworks.MySQLdb
5656private import semmle.python.frameworks.Numpy
57+ private import semmle.python.frameworks.OpenAI
5758private import semmle.python.frameworks.Opml
5859private import semmle.python.frameworks.Oracledb
5960private import semmle.python.frameworks.Pandas
Original file line number Diff line number Diff line change 1+ /**
2+ * Provides classes modeling security-relevant aspects of the `openAI`Agents SDK package.
3+ * See https://github.com/openai/openai-agents-python.
4+ */
5+
6+ private import python
7+ private import semmle.python.ApiGraphs
8+
9+ /**
10+ * Provides models for Agent (instances of the `agents.Agent` class).
11+ *
12+ * See https://github.com/openai/openai-agents-python.
13+ */
14+ module Agent {
15+ /** Gets a reference to the `agents.Agent` class. */
16+ API:: Node classRef ( ) { result = API:: moduleImport ( "agents" ) .getMember ( "Agent" ) }
17+
18+ /** Gets a reference to a potential property of `agents.Agent` called instructions which refers to the system prompt. */
19+ API:: Node sink ( ) { result = classRef ( ) .getACall ( ) .getKeywordParameter ( "instructions" ) }
20+ }
Original file line number Diff line number Diff line change 11/**
22 * @name Prompt injection
3+ * @description User input used in developer message and or system prompt can allow for Prompt Injection attacks.
34 * @kind path-problem
45 * @problem.severity error
56 * @security-severity 5.0
Original file line number Diff line number Diff line change 11query: Security/CWE-1427/PromptInjection.ql
2- postprocess: utils/test/InlineExpectationsTestQuery.ql
2+ postprocess: utils/test/InlineExpectationsTestQuery.ql
You can’t perform that action at this time.
0 commit comments