Skip to content

Commit 869f820

Browse files
Jami CogswellJami Cogswell
authored andcommitted
Shared: add 'SharedModelValidation' file as experiment
1 parent e24e3a6 commit 869f820

File tree

8 files changed

+219
-0
lines changed

8 files changed

+219
-0
lines changed

config/identical-files.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -598,5 +598,14 @@
598598
"EncryptionKeySizes Python/Java": [
599599
"python/ql/lib/semmle/python/security/internal/EncryptionKeySizes.qll",
600600
"java/ql/lib/semmle/code/java/security/internal/EncryptionKeySizes.qll"
601+
],
602+
"SharedModelValidation Java/C#/Go/JS/Python/Ruby/Swift (C++ is problematic for now)": [
603+
"java/ql/lib/semmle/code/java/dataflow/SharedModelValidation.qll",
604+
"csharp/ql/lib/semmle/code/csharp/dataflow/SharedModelValidation.qll",
605+
"go/ql/lib/semmle/go/dataflow/SharedModelValidation.qll",
606+
"swift/ql/lib/codeql/swift/dataflow/SharedModelValidation.qll",
607+
"javascript/ql/lib/semmle/javascript/frameworks/data/internal/SharedModelValidation.qll",
608+
"python/ql/lib/semmle/python/frameworks/data/internal/SharedModelValidation.qll",
609+
"ruby/ql/lib/codeql/ruby/frameworks/data/internal/SharedModelValidation.qll"
601610
]
602611
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/**
2+
* INTERNAL: Do not use.
3+
*
4+
* Provides classes for validating kinds in models as data rows.
5+
* Such that we can share this logic across our CodeQL analysis of different languages.
6+
*/
7+
class ValidSinkKind extends string {
8+
ValidSinkKind() {
9+
this =
10+
[
11+
// shared ALL languages
12+
"request-forgery", "ldap-injection", "sql-injection", "nosql-injection", "log-injection",
13+
"xpath-injection", "html-injection", "js-injection", "url-redirection", "path-injection",
14+
"file-content-store", "hostname-verification", "response-splitting", "information-leak",
15+
"xslt-injection", "template-injection", "fragment-injection", "command-injection",
16+
"unsafe-deserialization", "xxe", "database-store", "format-string",
17+
// .matches("credentials-%"), .matches("regex-use%")"
18+
// shared MOST languages
19+
"code-injection", // .matches("encryption-%"),
20+
// Java only
21+
"jndi-injection", "mvel-injection", "groovy-injection", "ognl-injection", "jexl-injection",
22+
"bean-validation", "intent-redirection", "pending-intents",
23+
// JS only
24+
"mongodb.sink",
25+
// Swift only
26+
"preferences-store", "transmission", "predicate-injection", "webview-fetch",
27+
"tls-protocol-version", "hash-iteration-count" // .matches("%string-%length"), .matches("weak-hash-input-")
28+
]
29+
}
30+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/**
2+
* INTERNAL: Do not use.
3+
*
4+
* Provides classes for validating kinds in models as data rows.
5+
* Such that we can share this logic across our CodeQL analysis of different languages.
6+
*/
7+
class ValidSinkKind extends string {
8+
ValidSinkKind() {
9+
this =
10+
[
11+
// shared ALL languages
12+
"request-forgery", "ldap-injection", "sql-injection", "nosql-injection", "log-injection",
13+
"xpath-injection", "html-injection", "js-injection", "url-redirection", "path-injection",
14+
"file-content-store", "hostname-verification", "response-splitting", "information-leak",
15+
"xslt-injection", "template-injection", "fragment-injection", "command-injection",
16+
"unsafe-deserialization", "xxe", "database-store", "format-string",
17+
// .matches("credentials-%"), .matches("regex-use%")"
18+
// shared MOST languages
19+
"code-injection", // .matches("encryption-%"),
20+
// Java only
21+
"jndi-injection", "mvel-injection", "groovy-injection", "ognl-injection", "jexl-injection",
22+
"bean-validation", "intent-redirection", "pending-intents",
23+
// JS only
24+
"mongodb.sink",
25+
// Swift only
26+
"preferences-store", "transmission", "predicate-injection", "webview-fetch",
27+
"tls-protocol-version", "hash-iteration-count" // .matches("%string-%length"), .matches("weak-hash-input-")
28+
]
29+
}
30+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/**
2+
* INTERNAL: Do not use.
3+
*
4+
* Provides classes for validating kinds in models as data rows.
5+
* Such that we can share this logic across our CodeQL analysis of different languages.
6+
*/
7+
class ValidSinkKind extends string {
8+
ValidSinkKind() {
9+
this =
10+
[
11+
// shared ALL languages
12+
"request-forgery", "ldap-injection", "sql-injection", "nosql-injection", "log-injection",
13+
"xpath-injection", "html-injection", "js-injection", "url-redirection", "path-injection",
14+
"file-content-store", "hostname-verification", "response-splitting", "information-leak",
15+
"xslt-injection", "template-injection", "fragment-injection", "command-injection",
16+
"unsafe-deserialization", "xxe", "database-store", "format-string",
17+
// .matches("credentials-%"), .matches("regex-use%")"
18+
// shared MOST languages
19+
"code-injection", // .matches("encryption-%"),
20+
// Java only
21+
"jndi-injection", "mvel-injection", "groovy-injection", "ognl-injection", "jexl-injection",
22+
"bean-validation", "intent-redirection", "pending-intents",
23+
// JS only
24+
"mongodb.sink",
25+
// Swift only
26+
"preferences-store", "transmission", "predicate-injection", "webview-fetch",
27+
"tls-protocol-version", "hash-iteration-count" // .matches("%string-%length"), .matches("weak-hash-input-")
28+
]
29+
}
30+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/**
2+
* INTERNAL: Do not use.
3+
*
4+
* Provides classes for validating kinds in models as data rows.
5+
* Such that we can share this logic across our CodeQL analysis of different languages.
6+
*/
7+
class ValidSinkKind extends string {
8+
ValidSinkKind() {
9+
this =
10+
[
11+
// shared ALL languages
12+
"request-forgery", "ldap-injection", "sql-injection", "nosql-injection", "log-injection",
13+
"xpath-injection", "html-injection", "js-injection", "url-redirection", "path-injection",
14+
"file-content-store", "hostname-verification", "response-splitting", "information-leak",
15+
"xslt-injection", "template-injection", "fragment-injection", "command-injection",
16+
"unsafe-deserialization", "xxe", "database-store", "format-string",
17+
// .matches("credentials-%"), .matches("regex-use%")"
18+
// shared MOST languages
19+
"code-injection", // .matches("encryption-%"),
20+
// Java only
21+
"jndi-injection", "mvel-injection", "groovy-injection", "ognl-injection", "jexl-injection",
22+
"bean-validation", "intent-redirection", "pending-intents",
23+
// JS only
24+
"mongodb.sink",
25+
// Swift only
26+
"preferences-store", "transmission", "predicate-injection", "webview-fetch",
27+
"tls-protocol-version", "hash-iteration-count" // .matches("%string-%length"), .matches("weak-hash-input-")
28+
]
29+
}
30+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/**
2+
* INTERNAL: Do not use.
3+
*
4+
* Provides classes for validating kinds in models as data rows.
5+
* Such that we can share this logic across our CodeQL analysis of different languages.
6+
*/
7+
class ValidSinkKind extends string {
8+
ValidSinkKind() {
9+
this =
10+
[
11+
// shared ALL languages
12+
"request-forgery", "ldap-injection", "sql-injection", "nosql-injection", "log-injection",
13+
"xpath-injection", "html-injection", "js-injection", "url-redirection", "path-injection",
14+
"file-content-store", "hostname-verification", "response-splitting", "information-leak",
15+
"xslt-injection", "template-injection", "fragment-injection", "command-injection",
16+
"unsafe-deserialization", "xxe", "database-store", "format-string",
17+
// .matches("credentials-%"), .matches("regex-use%")"
18+
// shared MOST languages
19+
"code-injection", // .matches("encryption-%"),
20+
// Java only
21+
"jndi-injection", "mvel-injection", "groovy-injection", "ognl-injection", "jexl-injection",
22+
"bean-validation", "intent-redirection", "pending-intents",
23+
// JS only
24+
"mongodb.sink",
25+
// Swift only
26+
"preferences-store", "transmission", "predicate-injection", "webview-fetch",
27+
"tls-protocol-version", "hash-iteration-count" // .matches("%string-%length"), .matches("weak-hash-input-")
28+
]
29+
}
30+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/**
2+
* INTERNAL: Do not use.
3+
*
4+
* Provides classes for validating kinds in models as data rows.
5+
* Such that we can share this logic across our CodeQL analysis of different languages.
6+
*/
7+
class ValidSinkKind extends string {
8+
ValidSinkKind() {
9+
this =
10+
[
11+
// shared ALL languages
12+
"request-forgery", "ldap-injection", "sql-injection", "nosql-injection", "log-injection",
13+
"xpath-injection", "html-injection", "js-injection", "url-redirection", "path-injection",
14+
"file-content-store", "hostname-verification", "response-splitting", "information-leak",
15+
"xslt-injection", "template-injection", "fragment-injection", "command-injection",
16+
"unsafe-deserialization", "xxe", "database-store", "format-string",
17+
// .matches("credentials-%"), .matches("regex-use%")"
18+
// shared MOST languages
19+
"code-injection", // .matches("encryption-%"),
20+
// Java only
21+
"jndi-injection", "mvel-injection", "groovy-injection", "ognl-injection", "jexl-injection",
22+
"bean-validation", "intent-redirection", "pending-intents",
23+
// JS only
24+
"mongodb.sink",
25+
// Swift only
26+
"preferences-store", "transmission", "predicate-injection", "webview-fetch",
27+
"tls-protocol-version", "hash-iteration-count" // .matches("%string-%length"), .matches("weak-hash-input-")
28+
]
29+
}
30+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/**
2+
* INTERNAL: Do not use.
3+
*
4+
* Provides classes for validating kinds in models as data rows.
5+
* Such that we can share this logic across our CodeQL analysis of different languages.
6+
*/
7+
class ValidSinkKind extends string {
8+
ValidSinkKind() {
9+
this =
10+
[
11+
// shared ALL languages
12+
"request-forgery", "ldap-injection", "sql-injection", "nosql-injection", "log-injection",
13+
"xpath-injection", "html-injection", "js-injection", "url-redirection", "path-injection",
14+
"file-content-store", "hostname-verification", "response-splitting", "information-leak",
15+
"xslt-injection", "template-injection", "fragment-injection", "command-injection",
16+
"unsafe-deserialization", "xxe", "database-store", "format-string",
17+
// .matches("credentials-%"), .matches("regex-use%")"
18+
// shared MOST languages
19+
"code-injection", // .matches("encryption-%"),
20+
// Java only
21+
"jndi-injection", "mvel-injection", "groovy-injection", "ognl-injection", "jexl-injection",
22+
"bean-validation", "intent-redirection", "pending-intents",
23+
// JS only
24+
"mongodb.sink",
25+
// Swift only
26+
"preferences-store", "transmission", "predicate-injection", "webview-fetch",
27+
"tls-protocol-version", "hash-iteration-count" // .matches("%string-%length"), .matches("weak-hash-input-")
28+
]
29+
}
30+
}

0 commit comments

Comments
 (0)