Skip to content

Commit db1508d

Browse files
committed
Swift: Trivial changes - query ID / metadata, imports.
1 parent 9774c3c commit db1508d

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

swift/ql/lib/codeql/swift/security/WeakPasswordHashingQuery.qll

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
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 {
3131
module 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() {

swift/ql/src/queries/Security/CWE-328/WeakPasswordHashing.qhelp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,12 @@
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>

swift/ql/src/queries/Security/CWE-328/WeakPasswordHashing.ql

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@
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
1717
import WeakHashingFlow::PathGraph
1818

1919
from

0 commit comments

Comments
 (0)