File tree Expand file tree Collapse file tree 3 files changed +10
-10
lines changed
lib/codeql/swift/security
src/queries/Security/CWE-328 Expand file tree Collapse file tree 3 files changed +10
-10
lines changed Original file line number Diff line number Diff line change 33 * cryptographic hashing algorithms on passwords.
44 */
55
6- import csharp
7- import semmle.code.csharp. security.SensitiveActions
8- import semmle.code.csharp .dataflow.DataFlow
9- import semmle.code.csharp .dataflow.TaintTracking
6+ import swift
7+ import codeql.swift. security.SensitiveExprs
8+ import codeql.swift .dataflow.DataFlow
9+ import codeql.swift .dataflow.TaintTracking
1010
1111/**
1212 * A taint tracking configuration from password expressions to inappropriate
@@ -31,7 +31,7 @@ module WeakHashingPasswordConfig implements DataFlow::ConfigSig {
3131module WeakHashingFlow = TaintTracking:: Global< WeakHashingPasswordConfig > ;
3232
3333// TODO: rewrite with data extensions in mind, ref the Swift implementation
34- class WeakPasswordHashingSink extends DataFlow:: Node {
34+ class WeakPasswordHashingSink extends DataFlow:: Node {
3535 string algorithm ;
3636
3737 WeakPasswordHashingSink ( ) {
Original file line number Diff line number Diff line change 6565
6666 In the first case the SHA-512 hashing algorithm is used. It is vulnerable to offline brute force attacks:
6767 </p >
68- <sample src =" WeakPasswordHashingBad.csharp " />
68+ <sample src =" WeakPasswordHashingBad.swift " />
6969 <p >
7070
7171 Here is the same function using Argon2, which is suitable for password hashing:
7272 </p >
73- <sample src =" WeakPasswordHashingGood.csharp " />
73+ <sample src =" WeakPasswordHashingGood.swift " />
7474
7575 </example >
7676 <references >
Original file line number Diff line number Diff line change 55 * @problem.severity warning
66 * @security-severity 7.5
77 * @precision high
8- * @id csharp /weak-password-hashing
8+ * @id swift /weak-password-hashing
99 * @tags security
1010 * external/cwe/cwe-327
1111 * external/cwe/cwe-328
1212 * external/cwe/cwe-916
1313 */
1414
15- import csharp
16- import WeakPasswordHashingQuery
15+ import swift
16+ import codeql.swift.security. WeakPasswordHashingQuery
1717import WeakHashingFlow:: PathGraph
1818
1919from
You can’t perform that action at this time.
0 commit comments