codesentry-semgrep-rules 0.1.4 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/rules/owasp.yml +276 -276
- package/rules/ruleset.lock.json +1 -1
package/package.json
CHANGED
package/rules/owasp.yml
CHANGED
|
@@ -17254,102 +17254,6 @@ rules:
|
|
|
17254
17254
|
- metavariable-comparison:
|
|
17255
17255
|
metavariable: $MOD
|
|
17256
17256
|
comparison: $MOD == 0o111
|
|
17257
|
-
- id: go.lang.security.injection.tainted-sql-string.tainted-sql-string
|
|
17258
|
-
languages:
|
|
17259
|
-
- go
|
|
17260
|
-
message: User data flows into this manually-constructed SQL string. User data can
|
|
17261
|
-
be safely inserted into SQL strings using prepared statements or an object-relational
|
|
17262
|
-
mapper (ORM). Manually-constructed SQL strings is a possible indicator of SQL
|
|
17263
|
-
injection, which could let an attacker steal or manipulate data from the database.
|
|
17264
|
-
Instead, use prepared statements (`db.Query("SELECT * FROM t WHERE id = ?", id)`)
|
|
17265
|
-
or a safe library.
|
|
17266
|
-
options:
|
|
17267
|
-
interfile: true
|
|
17268
|
-
metadata:
|
|
17269
|
-
cwe:
|
|
17270
|
-
- 'CWE-89: Improper Neutralization of Special Elements used in an SQL Command
|
|
17271
|
-
(''SQL Injection'')'
|
|
17272
|
-
owasp:
|
|
17273
|
-
- A01:2017 - Injection
|
|
17274
|
-
- A03:2021 - Injection
|
|
17275
|
-
- A05:2025 - Injection
|
|
17276
|
-
references:
|
|
17277
|
-
- https://golang.org/doc/database/sql-injection
|
|
17278
|
-
- https://www.stackhawk.com/blog/golang-sql-injection-guide-examples-and-prevention/
|
|
17279
|
-
category: security
|
|
17280
|
-
technology:
|
|
17281
|
-
- go
|
|
17282
|
-
confidence: HIGH
|
|
17283
|
-
cwe2022-top25: true
|
|
17284
|
-
cwe2021-top25: true
|
|
17285
|
-
subcategory:
|
|
17286
|
-
- vuln
|
|
17287
|
-
likelihood: HIGH
|
|
17288
|
-
impact: MEDIUM
|
|
17289
|
-
interfile: true
|
|
17290
|
-
license: Semgrep Rules License v1.0. For more details, visit semgrep.dev/legal/rules-license
|
|
17291
|
-
vulnerability_class:
|
|
17292
|
-
- SQL Injection
|
|
17293
|
-
source: https://semgrep.dev/r/go.lang.security.injection.tainted-sql-string.tainted-sql-string
|
|
17294
|
-
shortlink: https://sg.run/PbEq
|
|
17295
|
-
semgrep.dev:
|
|
17296
|
-
rule:
|
|
17297
|
-
r_id: 14689
|
|
17298
|
-
rv_id: 1409388
|
|
17299
|
-
rule_id: PeUoqy
|
|
17300
|
-
version_id: nWTQ5qD
|
|
17301
|
-
url: https://semgrep.dev/playground/r/nWTQ5qD/go.lang.security.injection.tainted-sql-string.tainted-sql-string
|
|
17302
|
-
origin: community
|
|
17303
|
-
mode: taint
|
|
17304
|
-
severity: ERROR
|
|
17305
|
-
pattern-sources:
|
|
17306
|
-
- patterns:
|
|
17307
|
-
- pattern-either:
|
|
17308
|
-
- pattern: |
|
|
17309
|
-
($REQUEST : *http.Request).$ANYTHING
|
|
17310
|
-
- pattern: |
|
|
17311
|
-
($REQUEST : http.Request).$ANYTHING
|
|
17312
|
-
- metavariable-regex:
|
|
17313
|
-
metavariable: $ANYTHING
|
|
17314
|
-
regex: ^(BasicAuth|Body|Cookie|Cookies|Form|FormValue|GetBody|Host|MultipartReader|ParseForm|ParseMultipartForm|PostForm|PostFormValue|Referer|RequestURI|Trailer|TransferEncoding|UserAgent|URL)$
|
|
17315
|
-
pattern-sinks:
|
|
17316
|
-
- patterns:
|
|
17317
|
-
- pattern-either:
|
|
17318
|
-
- patterns:
|
|
17319
|
-
- pattern-either:
|
|
17320
|
-
- pattern: |
|
|
17321
|
-
"$SQLSTR" + ...
|
|
17322
|
-
- patterns:
|
|
17323
|
-
- pattern-inside: |
|
|
17324
|
-
$VAR = "$SQLSTR";
|
|
17325
|
-
...
|
|
17326
|
-
- pattern: $VAR += ...
|
|
17327
|
-
- patterns:
|
|
17328
|
-
- pattern-inside: |
|
|
17329
|
-
var $SB strings.Builder
|
|
17330
|
-
...
|
|
17331
|
-
- pattern-inside: |
|
|
17332
|
-
$SB.WriteString("$SQLSTR")
|
|
17333
|
-
...
|
|
17334
|
-
$SB.String(...)
|
|
17335
|
-
- pattern: |
|
|
17336
|
-
$SB.WriteString(...)
|
|
17337
|
-
- metavariable-regex:
|
|
17338
|
-
metavariable: $SQLSTR
|
|
17339
|
-
regex: (?i)(select|delete|insert|create|update|alter|drop).*
|
|
17340
|
-
- patterns:
|
|
17341
|
-
- pattern-either:
|
|
17342
|
-
- pattern: fmt.Fprintf($F, "$SQLSTR", ...)
|
|
17343
|
-
- pattern: fmt.Sprintf("$SQLSTR", ...)
|
|
17344
|
-
- pattern: fmt.Printf("$SQLSTR", ...)
|
|
17345
|
-
- metavariable-regex:
|
|
17346
|
-
metavariable: $SQLSTR
|
|
17347
|
-
regex: \s*(?i)(select|delete|insert|create|update|alter|drop)\b.*%(v|s|q).*
|
|
17348
|
-
pattern-sanitizers:
|
|
17349
|
-
- pattern-either:
|
|
17350
|
-
- pattern: strconv.Atoi(...)
|
|
17351
|
-
- pattern: |
|
|
17352
|
-
($X: bool)
|
|
17353
17257
|
- id: php.doctrine.security.audit.doctrine-orm-dangerous-query.doctrine-orm-dangerous-query
|
|
17354
17258
|
languages:
|
|
17355
17259
|
- php
|
|
@@ -17983,34 +17887,292 @@ rules:
|
|
|
17983
17887
|
confidence: MEDIUM
|
|
17984
17888
|
subcategory:
|
|
17985
17889
|
- vuln
|
|
17986
|
-
likelihood: MEDIUM
|
|
17890
|
+
likelihood: MEDIUM
|
|
17891
|
+
impact: MEDIUM
|
|
17892
|
+
interfile: true
|
|
17893
|
+
license: Semgrep Rules License v1.0. For more details, visit semgrep.dev/legal/rules-license
|
|
17894
|
+
vulnerability_class:
|
|
17895
|
+
- Cryptographic Issues
|
|
17896
|
+
source: https://semgrep.dev/r/go.lang.security.audit.md5-used-as-password.md5-used-as-password
|
|
17897
|
+
shortlink: https://sg.run/4eOE
|
|
17898
|
+
semgrep.dev:
|
|
17899
|
+
rule:
|
|
17900
|
+
r_id: 14688
|
|
17901
|
+
rv_id: 1262938
|
|
17902
|
+
rule_id: 4bU1Wj
|
|
17903
|
+
version_id: nWT2L9r
|
|
17904
|
+
url: https://semgrep.dev/playground/r/nWT2L9r/go.lang.security.audit.md5-used-as-password.md5-used-as-password
|
|
17905
|
+
origin: community
|
|
17906
|
+
mode: taint
|
|
17907
|
+
pattern-sources:
|
|
17908
|
+
- patterns:
|
|
17909
|
+
- pattern-either:
|
|
17910
|
+
- pattern: md5.New
|
|
17911
|
+
- pattern: md5.Sum
|
|
17912
|
+
pattern-sinks:
|
|
17913
|
+
- patterns:
|
|
17914
|
+
- pattern: $FUNCTION(...)
|
|
17915
|
+
- metavariable-regex:
|
|
17916
|
+
metavariable: $FUNCTION
|
|
17917
|
+
regex: (?i)(.*password.*)
|
|
17918
|
+
- id: go.lang.security.injection.tainted-sql-string.tainted-sql-string
|
|
17919
|
+
languages:
|
|
17920
|
+
- go
|
|
17921
|
+
message: User data flows into this manually-constructed SQL string. User data can
|
|
17922
|
+
be safely inserted into SQL strings using prepared statements or an object-relational
|
|
17923
|
+
mapper (ORM). Manually-constructed SQL strings is a possible indicator of SQL
|
|
17924
|
+
injection, which could let an attacker steal or manipulate data from the database.
|
|
17925
|
+
Instead, use prepared statements (`db.Query("SELECT * FROM t WHERE id = ?", id)`)
|
|
17926
|
+
or a safe library.
|
|
17927
|
+
options:
|
|
17928
|
+
interfile: true
|
|
17929
|
+
metadata:
|
|
17930
|
+
cwe:
|
|
17931
|
+
- 'CWE-89: Improper Neutralization of Special Elements used in an SQL Command
|
|
17932
|
+
(''SQL Injection'')'
|
|
17933
|
+
owasp:
|
|
17934
|
+
- A01:2017 - Injection
|
|
17935
|
+
- A03:2021 - Injection
|
|
17936
|
+
- A05:2025 - Injection
|
|
17937
|
+
references:
|
|
17938
|
+
- https://golang.org/doc/database/sql-injection
|
|
17939
|
+
- https://www.stackhawk.com/blog/golang-sql-injection-guide-examples-and-prevention/
|
|
17940
|
+
category: security
|
|
17941
|
+
technology:
|
|
17942
|
+
- go
|
|
17943
|
+
confidence: HIGH
|
|
17944
|
+
cwe2022-top25: true
|
|
17945
|
+
cwe2021-top25: true
|
|
17946
|
+
subcategory:
|
|
17947
|
+
- vuln
|
|
17948
|
+
likelihood: HIGH
|
|
17949
|
+
impact: MEDIUM
|
|
17950
|
+
interfile: true
|
|
17951
|
+
license: Semgrep Rules License v1.0. For more details, visit semgrep.dev/legal/rules-license
|
|
17952
|
+
vulnerability_class:
|
|
17953
|
+
- SQL Injection
|
|
17954
|
+
source: https://semgrep.dev/r/go.lang.security.injection.tainted-sql-string.tainted-sql-string
|
|
17955
|
+
shortlink: https://sg.run/PbEq
|
|
17956
|
+
semgrep.dev:
|
|
17957
|
+
rule:
|
|
17958
|
+
r_id: 14689
|
|
17959
|
+
rv_id: 1409388
|
|
17960
|
+
rule_id: PeUoqy
|
|
17961
|
+
version_id: nWTQ5qD
|
|
17962
|
+
url: https://semgrep.dev/playground/r/nWTQ5qD/go.lang.security.injection.tainted-sql-string.tainted-sql-string
|
|
17963
|
+
origin: community
|
|
17964
|
+
mode: taint
|
|
17965
|
+
severity: ERROR
|
|
17966
|
+
pattern-sources:
|
|
17967
|
+
- patterns:
|
|
17968
|
+
- pattern-either:
|
|
17969
|
+
- pattern: |
|
|
17970
|
+
($REQUEST : *http.Request).$ANYTHING
|
|
17971
|
+
- pattern: |
|
|
17972
|
+
($REQUEST : http.Request).$ANYTHING
|
|
17973
|
+
- metavariable-regex:
|
|
17974
|
+
metavariable: $ANYTHING
|
|
17975
|
+
regex: ^(BasicAuth|Body|Cookie|Cookies|Form|FormValue|GetBody|Host|MultipartReader|ParseForm|ParseMultipartForm|PostForm|PostFormValue|Referer|RequestURI|Trailer|TransferEncoding|UserAgent|URL)$
|
|
17976
|
+
pattern-sinks:
|
|
17977
|
+
- patterns:
|
|
17978
|
+
- pattern-either:
|
|
17979
|
+
- patterns:
|
|
17980
|
+
- pattern-either:
|
|
17981
|
+
- pattern: |
|
|
17982
|
+
"$SQLSTR" + ...
|
|
17983
|
+
- patterns:
|
|
17984
|
+
- pattern-inside: |
|
|
17985
|
+
$VAR = "$SQLSTR";
|
|
17986
|
+
...
|
|
17987
|
+
- pattern: $VAR += ...
|
|
17988
|
+
- patterns:
|
|
17989
|
+
- pattern-inside: |
|
|
17990
|
+
var $SB strings.Builder
|
|
17991
|
+
...
|
|
17992
|
+
- pattern-inside: |
|
|
17993
|
+
$SB.WriteString("$SQLSTR")
|
|
17994
|
+
...
|
|
17995
|
+
$SB.String(...)
|
|
17996
|
+
- pattern: |
|
|
17997
|
+
$SB.WriteString(...)
|
|
17998
|
+
- metavariable-regex:
|
|
17999
|
+
metavariable: $SQLSTR
|
|
18000
|
+
regex: (?i)(select|delete|insert|create|update|alter|drop).*
|
|
18001
|
+
- patterns:
|
|
18002
|
+
- pattern-either:
|
|
18003
|
+
- pattern: fmt.Fprintf($F, "$SQLSTR", ...)
|
|
18004
|
+
- pattern: fmt.Sprintf("$SQLSTR", ...)
|
|
18005
|
+
- pattern: fmt.Printf("$SQLSTR", ...)
|
|
18006
|
+
- metavariable-regex:
|
|
18007
|
+
metavariable: $SQLSTR
|
|
18008
|
+
regex: \s*(?i)(select|delete|insert|create|update|alter|drop)\b.*%(v|s|q).*
|
|
18009
|
+
pattern-sanitizers:
|
|
18010
|
+
- pattern-either:
|
|
18011
|
+
- pattern: strconv.Atoi(...)
|
|
18012
|
+
- pattern: |
|
|
18013
|
+
($X: bool)
|
|
18014
|
+
- id: java.lang.security.audit.md5-used-as-password.md5-used-as-password
|
|
18015
|
+
languages:
|
|
18016
|
+
- java
|
|
18017
|
+
severity: WARNING
|
|
18018
|
+
message: It looks like MD5 is used as a password hash. MD5 is not considered a secure
|
|
18019
|
+
password hash because it can be cracked by an attacker in a short amount of time.
|
|
18020
|
+
Use a suitable password hashing function such as PBKDF2 or bcrypt. You can use
|
|
18021
|
+
`javax.crypto.SecretKeyFactory` with `SecretKeyFactory.getInstance("PBKDF2WithHmacSHA1")`
|
|
18022
|
+
or, if using Spring, `org.springframework.security.crypto.bcrypt`.
|
|
18023
|
+
metadata:
|
|
18024
|
+
category: security
|
|
18025
|
+
technology:
|
|
18026
|
+
- java
|
|
18027
|
+
- md5
|
|
18028
|
+
references:
|
|
18029
|
+
- https://tools.ietf.org/id/draft-lvelvindron-tls-md5-sha1-deprecate-01.html
|
|
18030
|
+
- https://github.com/returntocorp/semgrep-rules/issues/1609
|
|
18031
|
+
- https://docs.oracle.com/javase/7/docs/technotes/guides/security/StandardNames.html#SecretKeyFactory
|
|
18032
|
+
- https://docs.spring.io/spring-security/site/docs/current/api/org/springframework/security/crypto/bcrypt/BCryptPasswordEncoder.html
|
|
18033
|
+
owasp:
|
|
18034
|
+
- A03:2017 - Sensitive Data Exposure
|
|
18035
|
+
- A02:2021 - Cryptographic Failures
|
|
18036
|
+
- A04:2025 - Cryptographic Failures
|
|
18037
|
+
cwe:
|
|
18038
|
+
- 'CWE-327: Use of a Broken or Risky Cryptographic Algorithm'
|
|
18039
|
+
subcategory:
|
|
18040
|
+
- vuln
|
|
18041
|
+
likelihood: HIGH
|
|
18042
|
+
impact: MEDIUM
|
|
18043
|
+
confidence: MEDIUM
|
|
18044
|
+
license: Semgrep Rules License v1.0. For more details, visit semgrep.dev/legal/rules-license
|
|
18045
|
+
vulnerability_class:
|
|
18046
|
+
- Cryptographic Issues
|
|
18047
|
+
source: https://semgrep.dev/r/java.lang.security.audit.md5-used-as-password.md5-used-as-password
|
|
18048
|
+
shortlink: https://sg.run/JxEQ
|
|
18049
|
+
semgrep.dev:
|
|
18050
|
+
rule:
|
|
18051
|
+
r_id: 14690
|
|
18052
|
+
rv_id: 1263029
|
|
18053
|
+
rule_id: JDULAW
|
|
18054
|
+
version_id: bZT53QB
|
|
18055
|
+
url: https://semgrep.dev/playground/r/bZT53QB/java.lang.security.audit.md5-used-as-password.md5-used-as-password
|
|
18056
|
+
origin: community
|
|
18057
|
+
mode: taint
|
|
18058
|
+
pattern-sources:
|
|
18059
|
+
- patterns:
|
|
18060
|
+
- pattern-inside: |
|
|
18061
|
+
$TYPE $MD = MessageDigest.getInstance("MD5");
|
|
18062
|
+
...
|
|
18063
|
+
- pattern: $MD.digest(...);
|
|
18064
|
+
pattern-sinks:
|
|
18065
|
+
- patterns:
|
|
18066
|
+
- pattern: $MODEL.$METHOD(...);
|
|
18067
|
+
- metavariable-regex:
|
|
18068
|
+
metavariable: $METHOD
|
|
18069
|
+
regex: (?i)(.*password.*)
|
|
18070
|
+
- id: javascript.express.security.injection.raw-html-format.raw-html-format
|
|
18071
|
+
message: User data flows into the host portion of this manually-constructed HTML.
|
|
18072
|
+
This can introduce a Cross-Site-Scripting (XSS) vulnerability if this comes from
|
|
18073
|
+
user-provided input. Consider using a sanitization library such as DOMPurify to
|
|
18074
|
+
sanitize the HTML within.
|
|
18075
|
+
metadata:
|
|
18076
|
+
cwe:
|
|
18077
|
+
- 'CWE-79: Improper Neutralization of Input During Web Page Generation (''Cross-site
|
|
18078
|
+
Scripting'')'
|
|
18079
|
+
owasp:
|
|
18080
|
+
- A07:2017 - Cross-Site Scripting (XSS)
|
|
18081
|
+
- A03:2021 - Injection
|
|
18082
|
+
- A05:2025 - Injection
|
|
18083
|
+
references:
|
|
18084
|
+
- https://cheatsheetseries.owasp.org/cheatsheets/Cross_Site_Scripting_Prevention_Cheat_Sheet.html
|
|
18085
|
+
category: security
|
|
18086
|
+
technology:
|
|
18087
|
+
- express
|
|
18088
|
+
cwe2022-top25: true
|
|
18089
|
+
cwe2021-top25: true
|
|
18090
|
+
subcategory:
|
|
18091
|
+
- vuln
|
|
18092
|
+
likelihood: HIGH
|
|
17987
18093
|
impact: MEDIUM
|
|
17988
|
-
|
|
18094
|
+
confidence: MEDIUM
|
|
17989
18095
|
license: Semgrep Rules License v1.0. For more details, visit semgrep.dev/legal/rules-license
|
|
17990
18096
|
vulnerability_class:
|
|
17991
|
-
-
|
|
17992
|
-
source: https://semgrep.dev/r/
|
|
17993
|
-
shortlink: https://sg.run/
|
|
18097
|
+
- Cross-Site-Scripting (XSS)
|
|
18098
|
+
source: https://semgrep.dev/r/javascript.express.security.injection.raw-html-format.raw-html-format
|
|
18099
|
+
shortlink: https://sg.run/5DO3
|
|
17994
18100
|
semgrep.dev:
|
|
17995
18101
|
rule:
|
|
17996
|
-
r_id:
|
|
17997
|
-
rv_id:
|
|
17998
|
-
rule_id:
|
|
17999
|
-
version_id:
|
|
18000
|
-
url: https://semgrep.dev/playground/r/
|
|
18102
|
+
r_id: 14691
|
|
18103
|
+
rv_id: 1263175
|
|
18104
|
+
rule_id: 5rUL0X
|
|
18105
|
+
version_id: NdTzyQv
|
|
18106
|
+
url: https://semgrep.dev/playground/r/NdTzyQv/javascript.express.security.injection.raw-html-format.raw-html-format
|
|
18001
18107
|
origin: community
|
|
18108
|
+
languages:
|
|
18109
|
+
- javascript
|
|
18110
|
+
- typescript
|
|
18111
|
+
severity: WARNING
|
|
18002
18112
|
mode: taint
|
|
18003
18113
|
pattern-sources:
|
|
18004
|
-
-
|
|
18114
|
+
- label: EXPRESS
|
|
18115
|
+
patterns:
|
|
18005
18116
|
- pattern-either:
|
|
18006
|
-
- pattern:
|
|
18007
|
-
- pattern:
|
|
18008
|
-
|
|
18009
|
-
|
|
18010
|
-
|
|
18117
|
+
- pattern-inside: function ... ($REQ, $RES) {...}
|
|
18118
|
+
- pattern-inside: function ... ($REQ, $RES, $NEXT) {...}
|
|
18119
|
+
- patterns:
|
|
18120
|
+
- pattern-either:
|
|
18121
|
+
- pattern-inside: $APP.$METHOD(..., function $FUNC($REQ, $RES) {...})
|
|
18122
|
+
- pattern-inside: $APP.$METHOD(..., function $FUNC($REQ, $RES, $NEXT) {...})
|
|
18123
|
+
- metavariable-regex:
|
|
18124
|
+
metavariable: $METHOD
|
|
18125
|
+
regex: ^(get|post|put|head|delete|options)$
|
|
18126
|
+
- pattern-either:
|
|
18127
|
+
- pattern: $REQ.query
|
|
18128
|
+
- pattern: $REQ.body
|
|
18129
|
+
- pattern: $REQ.params
|
|
18130
|
+
- pattern: $REQ.cookies
|
|
18131
|
+
- pattern: $REQ.headers
|
|
18132
|
+
- label: EXPRESSTS
|
|
18133
|
+
patterns:
|
|
18134
|
+
- pattern-either:
|
|
18135
|
+
- pattern-inside: |
|
|
18136
|
+
({ $REQ }: Request,$RES: Response, $NEXT: NextFunction) =>
|
|
18137
|
+
{...}
|
|
18138
|
+
- pattern-inside: |
|
|
18139
|
+
({ $REQ }: Request,$RES: Response) => {...}
|
|
18140
|
+
- focus-metavariable: $REQ
|
|
18141
|
+
- pattern-either:
|
|
18142
|
+
- pattern: params
|
|
18143
|
+
- pattern: query
|
|
18144
|
+
- pattern: cookies
|
|
18145
|
+
- pattern: headers
|
|
18146
|
+
- pattern: body
|
|
18147
|
+
- label: CLEAN
|
|
18148
|
+
by-side-effect: true
|
|
18149
|
+
patterns:
|
|
18150
|
+
- pattern-either:
|
|
18151
|
+
- pattern: $A($SOURCE)
|
|
18152
|
+
- pattern: $SANITIZE. ... .$A($SOURCE)
|
|
18153
|
+
- pattern: $A. ... .$SANITIZE($SOURCE)
|
|
18154
|
+
- focus-metavariable: $SOURCE
|
|
18011
18155
|
- metavariable-regex:
|
|
18012
|
-
metavariable: $
|
|
18013
|
-
regex: (?i)(.*
|
|
18156
|
+
metavariable: $A
|
|
18157
|
+
regex: (?i)(.*valid|.*sanitiz)
|
|
18158
|
+
pattern-sinks:
|
|
18159
|
+
- requires: (EXPRESS and not CLEAN) or (EXPRESSTS and not CLEAN)
|
|
18160
|
+
patterns:
|
|
18161
|
+
- pattern-either:
|
|
18162
|
+
- patterns:
|
|
18163
|
+
- pattern-either:
|
|
18164
|
+
- pattern: '"$HTMLSTR" + $EXPR'
|
|
18165
|
+
- pattern: '"$HTMLSTR".concat(...)'
|
|
18166
|
+
- pattern: util.format($HTMLSTR, ...)
|
|
18167
|
+
- metavariable-pattern:
|
|
18168
|
+
metavariable: $HTMLSTR
|
|
18169
|
+
language: generic
|
|
18170
|
+
pattern: <$TAG ...
|
|
18171
|
+
- patterns:
|
|
18172
|
+
- pattern: |
|
|
18173
|
+
`...`
|
|
18174
|
+
- pattern-regex: |
|
|
18175
|
+
.*<\w+.*
|
|
18014
18176
|
- id: json.aws.security.wildcard-assume-role.wildcard-assume-role
|
|
18015
18177
|
patterns:
|
|
18016
18178
|
- pattern-inside: |
|
|
@@ -39750,168 +39912,6 @@ rules:
|
|
|
39750
39912
|
- pattern-regex: \$\{\{\s*secrets\.
|
|
39751
39913
|
- pattern-not-inside: 'jobs: ...'
|
|
39752
39914
|
severity: WARNING
|
|
39753
|
-
- id: java.lang.security.audit.md5-used-as-password.md5-used-as-password
|
|
39754
|
-
languages:
|
|
39755
|
-
- java
|
|
39756
|
-
severity: WARNING
|
|
39757
|
-
message: It looks like MD5 is used as a password hash. MD5 is not considered a secure
|
|
39758
|
-
password hash because it can be cracked by an attacker in a short amount of time.
|
|
39759
|
-
Use a suitable password hashing function such as PBKDF2 or bcrypt. You can use
|
|
39760
|
-
`javax.crypto.SecretKeyFactory` with `SecretKeyFactory.getInstance("PBKDF2WithHmacSHA1")`
|
|
39761
|
-
or, if using Spring, `org.springframework.security.crypto.bcrypt`.
|
|
39762
|
-
metadata:
|
|
39763
|
-
category: security
|
|
39764
|
-
technology:
|
|
39765
|
-
- java
|
|
39766
|
-
- md5
|
|
39767
|
-
references:
|
|
39768
|
-
- https://tools.ietf.org/id/draft-lvelvindron-tls-md5-sha1-deprecate-01.html
|
|
39769
|
-
- https://github.com/returntocorp/semgrep-rules/issues/1609
|
|
39770
|
-
- https://docs.oracle.com/javase/7/docs/technotes/guides/security/StandardNames.html#SecretKeyFactory
|
|
39771
|
-
- https://docs.spring.io/spring-security/site/docs/current/api/org/springframework/security/crypto/bcrypt/BCryptPasswordEncoder.html
|
|
39772
|
-
owasp:
|
|
39773
|
-
- A03:2017 - Sensitive Data Exposure
|
|
39774
|
-
- A02:2021 - Cryptographic Failures
|
|
39775
|
-
- A04:2025 - Cryptographic Failures
|
|
39776
|
-
cwe:
|
|
39777
|
-
- 'CWE-327: Use of a Broken or Risky Cryptographic Algorithm'
|
|
39778
|
-
subcategory:
|
|
39779
|
-
- vuln
|
|
39780
|
-
likelihood: HIGH
|
|
39781
|
-
impact: MEDIUM
|
|
39782
|
-
confidence: MEDIUM
|
|
39783
|
-
license: Semgrep Rules License v1.0. For more details, visit semgrep.dev/legal/rules-license
|
|
39784
|
-
vulnerability_class:
|
|
39785
|
-
- Cryptographic Issues
|
|
39786
|
-
source: https://semgrep.dev/r/java.lang.security.audit.md5-used-as-password.md5-used-as-password
|
|
39787
|
-
shortlink: https://sg.run/JxEQ
|
|
39788
|
-
semgrep.dev:
|
|
39789
|
-
rule:
|
|
39790
|
-
r_id: 14690
|
|
39791
|
-
rv_id: 1263029
|
|
39792
|
-
rule_id: JDULAW
|
|
39793
|
-
version_id: bZT53QB
|
|
39794
|
-
url: https://semgrep.dev/playground/r/bZT53QB/java.lang.security.audit.md5-used-as-password.md5-used-as-password
|
|
39795
|
-
origin: community
|
|
39796
|
-
mode: taint
|
|
39797
|
-
pattern-sources:
|
|
39798
|
-
- patterns:
|
|
39799
|
-
- pattern-inside: |
|
|
39800
|
-
$TYPE $MD = MessageDigest.getInstance("MD5");
|
|
39801
|
-
...
|
|
39802
|
-
- pattern: $MD.digest(...);
|
|
39803
|
-
pattern-sinks:
|
|
39804
|
-
- patterns:
|
|
39805
|
-
- pattern: $MODEL.$METHOD(...);
|
|
39806
|
-
- metavariable-regex:
|
|
39807
|
-
metavariable: $METHOD
|
|
39808
|
-
regex: (?i)(.*password.*)
|
|
39809
|
-
- id: javascript.express.security.injection.raw-html-format.raw-html-format
|
|
39810
|
-
message: User data flows into the host portion of this manually-constructed HTML.
|
|
39811
|
-
This can introduce a Cross-Site-Scripting (XSS) vulnerability if this comes from
|
|
39812
|
-
user-provided input. Consider using a sanitization library such as DOMPurify to
|
|
39813
|
-
sanitize the HTML within.
|
|
39814
|
-
metadata:
|
|
39815
|
-
cwe:
|
|
39816
|
-
- 'CWE-79: Improper Neutralization of Input During Web Page Generation (''Cross-site
|
|
39817
|
-
Scripting'')'
|
|
39818
|
-
owasp:
|
|
39819
|
-
- A07:2017 - Cross-Site Scripting (XSS)
|
|
39820
|
-
- A03:2021 - Injection
|
|
39821
|
-
- A05:2025 - Injection
|
|
39822
|
-
references:
|
|
39823
|
-
- https://cheatsheetseries.owasp.org/cheatsheets/Cross_Site_Scripting_Prevention_Cheat_Sheet.html
|
|
39824
|
-
category: security
|
|
39825
|
-
technology:
|
|
39826
|
-
- express
|
|
39827
|
-
cwe2022-top25: true
|
|
39828
|
-
cwe2021-top25: true
|
|
39829
|
-
subcategory:
|
|
39830
|
-
- vuln
|
|
39831
|
-
likelihood: HIGH
|
|
39832
|
-
impact: MEDIUM
|
|
39833
|
-
confidence: MEDIUM
|
|
39834
|
-
license: Semgrep Rules License v1.0. For more details, visit semgrep.dev/legal/rules-license
|
|
39835
|
-
vulnerability_class:
|
|
39836
|
-
- Cross-Site-Scripting (XSS)
|
|
39837
|
-
source: https://semgrep.dev/r/javascript.express.security.injection.raw-html-format.raw-html-format
|
|
39838
|
-
shortlink: https://sg.run/5DO3
|
|
39839
|
-
semgrep.dev:
|
|
39840
|
-
rule:
|
|
39841
|
-
r_id: 14691
|
|
39842
|
-
rv_id: 1263175
|
|
39843
|
-
rule_id: 5rUL0X
|
|
39844
|
-
version_id: NdTzyQv
|
|
39845
|
-
url: https://semgrep.dev/playground/r/NdTzyQv/javascript.express.security.injection.raw-html-format.raw-html-format
|
|
39846
|
-
origin: community
|
|
39847
|
-
languages:
|
|
39848
|
-
- javascript
|
|
39849
|
-
- typescript
|
|
39850
|
-
severity: WARNING
|
|
39851
|
-
mode: taint
|
|
39852
|
-
pattern-sources:
|
|
39853
|
-
- label: EXPRESS
|
|
39854
|
-
patterns:
|
|
39855
|
-
- pattern-either:
|
|
39856
|
-
- pattern-inside: function ... ($REQ, $RES) {...}
|
|
39857
|
-
- pattern-inside: function ... ($REQ, $RES, $NEXT) {...}
|
|
39858
|
-
- patterns:
|
|
39859
|
-
- pattern-either:
|
|
39860
|
-
- pattern-inside: $APP.$METHOD(..., function $FUNC($REQ, $RES) {...})
|
|
39861
|
-
- pattern-inside: $APP.$METHOD(..., function $FUNC($REQ, $RES, $NEXT) {...})
|
|
39862
|
-
- metavariable-regex:
|
|
39863
|
-
metavariable: $METHOD
|
|
39864
|
-
regex: ^(get|post|put|head|delete|options)$
|
|
39865
|
-
- pattern-either:
|
|
39866
|
-
- pattern: $REQ.query
|
|
39867
|
-
- pattern: $REQ.body
|
|
39868
|
-
- pattern: $REQ.params
|
|
39869
|
-
- pattern: $REQ.cookies
|
|
39870
|
-
- pattern: $REQ.headers
|
|
39871
|
-
- label: EXPRESSTS
|
|
39872
|
-
patterns:
|
|
39873
|
-
- pattern-either:
|
|
39874
|
-
- pattern-inside: |
|
|
39875
|
-
({ $REQ }: Request,$RES: Response, $NEXT: NextFunction) =>
|
|
39876
|
-
{...}
|
|
39877
|
-
- pattern-inside: |
|
|
39878
|
-
({ $REQ }: Request,$RES: Response) => {...}
|
|
39879
|
-
- focus-metavariable: $REQ
|
|
39880
|
-
- pattern-either:
|
|
39881
|
-
- pattern: params
|
|
39882
|
-
- pattern: query
|
|
39883
|
-
- pattern: cookies
|
|
39884
|
-
- pattern: headers
|
|
39885
|
-
- pattern: body
|
|
39886
|
-
- label: CLEAN
|
|
39887
|
-
by-side-effect: true
|
|
39888
|
-
patterns:
|
|
39889
|
-
- pattern-either:
|
|
39890
|
-
- pattern: $A($SOURCE)
|
|
39891
|
-
- pattern: $SANITIZE. ... .$A($SOURCE)
|
|
39892
|
-
- pattern: $A. ... .$SANITIZE($SOURCE)
|
|
39893
|
-
- focus-metavariable: $SOURCE
|
|
39894
|
-
- metavariable-regex:
|
|
39895
|
-
metavariable: $A
|
|
39896
|
-
regex: (?i)(.*valid|.*sanitiz)
|
|
39897
|
-
pattern-sinks:
|
|
39898
|
-
- requires: (EXPRESS and not CLEAN) or (EXPRESSTS and not CLEAN)
|
|
39899
|
-
patterns:
|
|
39900
|
-
- pattern-either:
|
|
39901
|
-
- patterns:
|
|
39902
|
-
- pattern-either:
|
|
39903
|
-
- pattern: '"$HTMLSTR" + $EXPR'
|
|
39904
|
-
- pattern: '"$HTMLSTR".concat(...)'
|
|
39905
|
-
- pattern: util.format($HTMLSTR, ...)
|
|
39906
|
-
- metavariable-pattern:
|
|
39907
|
-
metavariable: $HTMLSTR
|
|
39908
|
-
language: generic
|
|
39909
|
-
pattern: <$TAG ...
|
|
39910
|
-
- patterns:
|
|
39911
|
-
- pattern: |
|
|
39912
|
-
`...`
|
|
39913
|
-
- pattern-regex: |
|
|
39914
|
-
.*<\w+.*
|
|
39915
39915
|
- id: kotlin.lang.security.ecb-cipher.ecb-cipher
|
|
39916
39916
|
metadata:
|
|
39917
39917
|
cwe:
|
package/rules/ruleset.lock.json
CHANGED