add tests

This commit is contained in:
liangjinhuang
2021-12-04 00:52:15 +08:00
parent d0ac11817e
commit 1102f60f3e
3 changed files with 12 additions and 0 deletions

View File

@@ -0,0 +1,6 @@
edges
nodes
| InsecureRandomness.py:5:12:5:26 | ControlFlowNode for Attribute() | semmle.label | ControlFlowNode for Attribute() |
subpaths
#select
| InsecureRandomness.py:5:12:5:26 | ControlFlowNode for Attribute() | InsecureRandomness.py:5:12:5:26 | ControlFlowNode for Attribute() | InsecureRandomness.py:5:12:5:26 | ControlFlowNode for Attribute() | Cryptographically insecure $@ in a security context. | InsecureRandomness.py:5:12:5:26 | ControlFlowNode for Attribute() | random value |

View File

@@ -0,0 +1,5 @@
import random
def generatePassword():
# BAD: the random is not cryptographically secure
return random.random()

View File

@@ -0,0 +1 @@
experimental/Security/CWE-338/InsecureRandomness.ql