Skip to content

Commit 6fbd0ea

Browse files
authored
Merge pull request #50 from GitHubSecurityLab/js-audit-sqlinjection
Create JS SqlInjectionAudit.ql
2 parents 40f8159 + 3a01067 commit 6fbd0ea

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Audit: Usage of unsafe Database query
2+
3+
This query detects the use of unsafe sql injection sinks. Unsafe sql sinks are functions that can lead to remote code execution if user controled input comes into the sink
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/**
2+
* @name Audit: Database query built from user-controlled sources
3+
* @description A SQL Injection sink is being used in your application, this can lead to remote code execution if user controled input comes into the sink
4+
* @kind problem
5+
* @problem.severity error
6+
* @security-severity 3.0
7+
* @id githubsecuritylab/audit/sql-injection
8+
* @tags security
9+
* external/cwe/cwe-089
10+
* external/cwe/cwe-090
11+
* external/cwe/cwe-943
12+
* audit
13+
*/
14+
15+
import javascript
16+
import semmle.javascript.security.dataflow.SqlInjectionQuery as SqlInjection
17+
import semmle.javascript.security.dataflow.NosqlInjectionQuery as NosqlInjection
18+
19+
from DataFlow::Node sink
20+
where sink instanceof SqlInjection::Sink or sink instanceof NosqlInjection::Sink
21+
select sink, "Possible SQL Injection sink"

0 commit comments

Comments
 (0)