Merge pull request #7252 from museljh/feature/cwe-338

Python: CWE-338 insecureRandomness
This commit is contained in:
Rasmus Wriedt Larsen
2022-02-07 19:30:06 +01:00
committed by GitHub
9 changed files with 212 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