| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent d0ffde8 commit e612db2
14 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2,8 +2,8 @@ | |||
| 2 | 2 | * Provides a taint-tracking configuration for detecting "prompt injection" vulnerabilities. | |
| 3 | 3 | * | |
| 4 | 4 | * Note, for performance reasons: only import this file if | |
| 5 | - * `PromptInjection::Configuration` is needed, otherwise | ||
| 6 | - * `PromptInjectionCustomizations` should be imported instead. | ||
| 5 | + * `UserPromptInjectionFlow::Configuration` is needed, otherwise | ||
| 6 | + * `UserPromptInjectionCustomizations` should be imported instead. | ||
| 7 | 7 | */ | |
| 8 | 8 | ||
| 9 | 9 | private import javascript | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -20,7 +20,7 @@ context, or trigger unintended tool calls.</p> | |||
| 20 | 20 | <ul> | |
| 21 | 21 | <li>Ensure that all data flowing into user-input is intended and necessary for the purpose of the AI system.</li> | |
| 22 | 22 | <li>Ensure the system prompt clearly describes the purpose, scope and boundaries of the AI system. Instruct the system to deny input that falls outside these boundaries.</li> | |
| 23 | - <li>If creating a prompt out of multiple user-controlled values, assume that each of them can be malicious. Ensure the range of possible values is restricted and validated. | ||
| 23 | + <li>If creating a prompt out of multiple user-controlled values, assume that each of them can be malicious. Ensure the range of possible values is restricted and validated. | ||
| 24 | 24 | For example, if a prompt includes a question and the intended language to respond in, validate that the language is one of the supported options.</li> | |
| 25 | 25 | <li>Consider using guardrails on the input like the OpenAI guardrails library to enforce constraints and prevent malicious content from being processed.</li> | |
| 26 | 26 | <li>Apply output filtering to detect and block responses that indicate prompt injection attempts.</li> | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -5,15 +5,14 @@ | |||
| 5 | 5 | * @kind path-problem | |
| 6 | 6 | * @problem.severity warning | |
| 7 | 7 | * @security-severity 5.0 | |
| 8 | - * @precision medium | ||
| 8 | + * @precision low | ||
| 9 | 9 | * @id js/user-prompt-injection | |
| 10 | 10 | * @tags security | |
| 11 | - * experimental | ||
| 12 | 11 | * external/cwe/cwe-1427 | |
| 13 | 12 | */ | |
| 14 | 13 | ||
| 15 | 14 | import javascript | |
| 16 | - import experimental.semmle.javascript.security.PromptInjection.UserPromptinjectionQuery | ||
| 15 | + import semmle.javascript.security.dataflow.UserPromptInjectionQuery | ||
| 17 | 16 | import UserPromptInjectionFlow::PathGraph | |
| 18 | 17 | ||
| 19 | 18 | from UserPromptInjectionFlow::PathNode source, UserPromptInjectionFlow::PathNode sink | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1 @@ | |||
| 1 | + Security/CWE-1427/UserPromptInjection.ql | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments