Loading...
Loading...
Compare original and translation side by side
graph TD
A[Codebase] --> B{Analysis Engine}
B -->|Data Flow| C[CodeQL: Build Database]
B -->|Pattern Match| D[Semgrep: Parse AST]
C --> E[Run CodeQL Queries]
D --> F[Run Semgrep Rules]
E --> G[Taint Tracking: Source → Sink]
F --> H[Pattern Matches + Metavariables]
G --> I[Merge Findings]
H --> I
I --> J[Deduplicate + Prioritize]
J --> K[Remediation Report]
K --> L[CI/CD Gate: Pass/Fail]graph TD
A[Codebase] --> B{Analysis Engine}
B -->|Data Flow| C[CodeQL: Build Database]
B -->|Pattern Match| D[Semgrep: Parse AST]
C --> E[Run CodeQL Queries]
D --> F[Run Semgrep Rules]
E --> G[Taint Tracking: Source → Sink]
F --> H[Pattern Matches + Metavariables]
G --> I[Merge Findings]
H --> I
I --> J[Deduplicate + Prioritize]
J --> K[Remediation Report]
K --> L[CI/CD Gate: Pass/Fail]undefinedundefinedundefinedundefined/**
* @name SQL injection from request parameter
* @description Finds SQL queries constructed from HTTP request parameters
* @kind path-problem
* @severity error
* @id agent-skills/sql-injection
* @tags security
* cwe-089
*/
import python
import semmle.python.dataflow.new.TaintTracking
import semmle.python.ApiGraphs
class SqlInjectionConfig extends TaintTracking::Configuration {
SqlInjectionConfig() { this = "SqlInjectionConfig" }
override predicate isSource(DataFlow::Node source) {
exists(API::CallNode call |
call = API::moduleImport("flask").getMember("request").getMember("args").getMember("get").getACall() and
source = call
)
}
override predicate isSink(DataFlow::Node sink) {
exists(API::CallNode call |
call = API::moduleImport("sqlite3").getMember("Cursor").getMember("execute").getACall() and
sink = call.getArg(0)
)
}
}
from SqlInjectionConfig config, DataFlow::PathNode source, DataFlow::PathNode sink
where config.hasFlowPath(source, sink)
select sink.getNode(), source, sink, "SQL query depends on $@.", source.getNode(), "user input"/**
* @name SQL injection from request parameter
* @description Finds SQL queries constructed from HTTP request parameters
* @kind path-problem
* @severity error
* @id agent-skills/sql-injection
* @tags security
* cwe-089
*/
import python
import semmle.python.dataflow.new.TaintTracking
import semmle.python.ApiGraphs
class SqlInjectionConfig extends TaintTracking::Configuration {
SqlInjectionConfig() { this = "SqlInjectionConfig" }
override predicate isSource(DataFlow::Node source) {
exists(API::CallNode call |
call = API::moduleImport("flask").getMember("request").getMember("args").getMember("get").getACall() and
source = call
)
}
override predicate isSink(DataFlow::Node sink) {
exists(API::CallNode call |
call = API::moduleImport("sqlite3").getMember("Cursor").getMember("execute").getACall() and
sink = call.getArg(0)
)
}
}
from SqlInjectionConfig config, DataFlow::PathNode source, DataFlow::PathNode sink
where config.hasFlowPath(source, sink)
select sink.getNode(), source, sink, "SQL query depends on $@.", source.getNode(), "user input"undefinedundefinedundefinedundefined| Platform | Support | Notes |
|---|---|---|
| Cursor | Full | Rule authoring + CI config |
| VS Code | Full | Semgrep extension |
| Windsurf | Full | Static analysis integration |
| Claude Code | Full | Query/rule generation |
| Cline | Full | Security rule authoring |
| aider | Partial | YAML/QL file editing |
| 平台 | 支持情况 | 备注 |
|---|---|---|
| Cursor | 完全支持 | 规则编写 + CI 配置 |
| VS Code | 完全支持 | Semgrep 扩展 |
| Windsurf | 完全支持 | 静态分析集成 |
| Claude Code | 完全支持 | 查询/规则生成 |
| Cline | 完全支持 | 安全规则编写 |
| aider | 部分支持 | YAML/QL 文件编辑 |
codeqlsemgrepstatic-analysissasttaint-trackingcustom-rulesvulnerability-detectionci-cd-securitycodeqlsemgrepstatic-analysissasttaint-trackingcustom-rulesvulnerability-detectionci-cd-security