-
Notifications
You must be signed in to change notification settings - Fork 2k
Expand file tree
/
Copy pathConstantSalt.ql
More file actions
24 lines (22 loc) · 864 Bytes
/
ConstantSalt.ql
File metadata and controls
24 lines (22 loc) · 864 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/**
* @name Use of constant salts
* @description Using constant salts for password hashing is not secure because potential attackers can precompute the hash value via dictionary attacks.
* @kind path-problem
* @problem.severity error
* @security-severity 7.5
* @precision high
* @id swift/constant-salt
* @tags security
* external/cwe/cwe-760
*/
import swift
import codeql.swift.security.ConstantSaltQuery
import ConstantSaltFlow::PathGraph
from
ConstantSaltFlow::PathNode sourcePathNode, ConstantSaltFlow::PathNode sinkPathNode,
DataFlow::Node sourceNode
where
ConstantSaltFlow::flowPath(sourcePathNode, sinkPathNode) and sourceNode = sourcePathNode.getNode()
select sinkPathNode.getNode(), sourcePathNode, sinkPathNode,
"The value $@ is used as a constant, which is insecure for hashing passwords.", sourceNode,
sourceNode.toString()