diff --git a/ql/src/Security/CWE-327/InsecureRandomness.go b/ql/src/Security/CWE-338/InsecureRandomness.go similarity index 100% rename from ql/src/Security/CWE-327/InsecureRandomness.go rename to ql/src/Security/CWE-338/InsecureRandomness.go diff --git a/ql/src/Security/CWE-327/InsecureRandomness.qhelp b/ql/src/Security/CWE-338/InsecureRandomness.qhelp similarity index 100% rename from ql/src/Security/CWE-327/InsecureRandomness.qhelp rename to ql/src/Security/CWE-338/InsecureRandomness.qhelp diff --git a/ql/src/Security/CWE-327/InsecureRandomness.ql b/ql/src/Security/CWE-338/InsecureRandomness.ql similarity index 93% rename from ql/src/Security/CWE-327/InsecureRandomness.ql rename to ql/src/Security/CWE-338/InsecureRandomness.ql index d114097b3bc..29f42055bfd 100644 --- a/ql/src/Security/CWE-327/InsecureRandomness.ql +++ b/ql/src/Security/CWE-338/InsecureRandomness.ql @@ -3,9 +3,10 @@ * @description Using insufficient randomness as the key of a cryptographic algorithm can allow an attacker to compromise security. * @kind path-problem * @problem.severity error + * @precision high * @id go/insecure-randomness * @tags security - * external/cwe/cwe-327 + * external/cwe/cwe-338 */ import go diff --git a/ql/src/Security/CWE-327/InsecureRandomnessGood.go b/ql/src/Security/CWE-338/InsecureRandomnessGood.go similarity index 100% rename from ql/src/Security/CWE-327/InsecureRandomnessGood.go rename to ql/src/Security/CWE-338/InsecureRandomnessGood.go diff --git a/ql/test/query-tests/Security/CWE-327/InsecureRandomness/Crypto.go b/ql/test/query-tests/Security/CWE-327/Crypto.go similarity index 98% rename from ql/test/query-tests/Security/CWE-327/InsecureRandomness/Crypto.go rename to ql/test/query-tests/Security/CWE-327/Crypto.go index bc2b2fdeba4..75229b020a8 100644 --- a/ql/test/query-tests/Security/CWE-327/InsecureRandomness/Crypto.go +++ b/ql/test/query-tests/Security/CWE-327/Crypto.go @@ -9,7 +9,7 @@ import ( "crypto/sha256" ) -func main() { +func crypto() { public := []byte("hello") password := []byte("123456") diff --git a/ql/test/query-tests/Security/CWE-327/InsecureRandomness/InsecureRandomness.qlref b/ql/test/query-tests/Security/CWE-327/InsecureRandomness/InsecureRandomness.qlref deleted file mode 100644 index 2fea70189fe..00000000000 --- a/ql/test/query-tests/Security/CWE-327/InsecureRandomness/InsecureRandomness.qlref +++ /dev/null @@ -1 +0,0 @@ -Security/CWE-327/InsecureRandomness.ql diff --git a/ql/test/query-tests/Security/CWE-327/InsecureRandomness/WeakCryptoAlgorithm.expected b/ql/test/query-tests/Security/CWE-327/WeakCryptoAlgorithm.expected similarity index 100% rename from ql/test/query-tests/Security/CWE-327/InsecureRandomness/WeakCryptoAlgorithm.expected rename to ql/test/query-tests/Security/CWE-327/WeakCryptoAlgorithm.expected diff --git a/ql/test/query-tests/Security/CWE-327/InsecureRandomness/WeakCryptoAlgorithm.qlref b/ql/test/query-tests/Security/CWE-327/WeakCryptoAlgorithm.qlref similarity index 100% rename from ql/test/query-tests/Security/CWE-327/InsecureRandomness/WeakCryptoAlgorithm.qlref rename to ql/test/query-tests/Security/CWE-327/WeakCryptoAlgorithm.qlref diff --git a/ql/test/query-tests/Security/CWE-327/InsecureRandomness/InsecureRandomness.expected b/ql/test/query-tests/Security/CWE-338/InsecureRandomness/InsecureRandomness.expected similarity index 100% rename from ql/test/query-tests/Security/CWE-327/InsecureRandomness/InsecureRandomness.expected rename to ql/test/query-tests/Security/CWE-338/InsecureRandomness/InsecureRandomness.expected diff --git a/ql/test/query-tests/Security/CWE-327/InsecureRandomness/InsecureRandomness.go b/ql/test/query-tests/Security/CWE-338/InsecureRandomness/InsecureRandomness.go similarity index 100% rename from ql/test/query-tests/Security/CWE-327/InsecureRandomness/InsecureRandomness.go rename to ql/test/query-tests/Security/CWE-338/InsecureRandomness/InsecureRandomness.go diff --git a/ql/test/query-tests/Security/CWE-338/InsecureRandomness/InsecureRandomness.qlref b/ql/test/query-tests/Security/CWE-338/InsecureRandomness/InsecureRandomness.qlref new file mode 100644 index 00000000000..6d5708b15df --- /dev/null +++ b/ql/test/query-tests/Security/CWE-338/InsecureRandomness/InsecureRandomness.qlref @@ -0,0 +1 @@ +Security/CWE-338/InsecureRandomness.ql diff --git a/ql/test/query-tests/Security/CWE-327/InsecureRandomness/InsecureRandomnessGood.go b/ql/test/query-tests/Security/CWE-338/InsecureRandomness/InsecureRandomnessGood.go similarity index 100% rename from ql/test/query-tests/Security/CWE-327/InsecureRandomness/InsecureRandomnessGood.go rename to ql/test/query-tests/Security/CWE-338/InsecureRandomness/InsecureRandomnessGood.go diff --git a/ql/test/query-tests/Security/CWE-327/InsecureRandomness/go.mod b/ql/test/query-tests/Security/CWE-338/InsecureRandomness/go.mod similarity index 100% rename from ql/test/query-tests/Security/CWE-327/InsecureRandomness/go.mod rename to ql/test/query-tests/Security/CWE-338/InsecureRandomness/go.mod diff --git a/ql/test/query-tests/Security/CWE-327/InsecureRandomness/sample.go b/ql/test/query-tests/Security/CWE-338/InsecureRandomness/sample.go similarity index 100% rename from ql/test/query-tests/Security/CWE-327/InsecureRandomness/sample.go rename to ql/test/query-tests/Security/CWE-338/InsecureRandomness/sample.go