Files
codeql/python/ql/src/Security/CWE-327
Rasmus Wriedt Larsen 605bd19306 Python: Add CWE-328 to py/weak-sensitive-data-hashing
Reading over the description at https://cwe.mitre.org/data/definitions/328.html:

> The product uses a hashing algorithm that produces a hash value that can be used to determine the original input, or to find an input that can produce the same hash, more efficiently than brute force techniques.

For the data that does not require computationally expensive hashing, that will be the exactly problems that this query finds 👍 (that is, MD5, SHA1)
2021-08-25 10:19:22 +02:00
..
2021-06-18 18:30:27 +00:00
2021-06-18 17:22:42 +00:00
2021-04-12 08:16:36 +02:00
2021-04-20 18:54:03 +02:00

Current status (Feb 2021)

This should be kept up to date; the world is moving fast and protocols are being broken.

Protocols

  • All versions of SSL are insecure
  • TLS 1.0 and TLS 1.1 are insecure
  • TLS 1.2 have some issues. but TLS 1.3 is not widely supported

Conection methods

  • ssl.wrap_socket is creating insecure connections, use SSLContext.wrap_socket instead. link

    Deprecated since version 3.7: Since Python 3.2 and 2.7.9, it is recommended to use the SSLContext.wrap_socket() instead of wrap_socket(). The top-level function is limited and creates an insecure client socket without server name indication or hostname matching.

  • Default constructors are fine, a fluent API is used to constrain possible protocols later.

Current recomendation

TLS 1.2 or TLS 1.3

Queries

  • InsecureProtocol detects uses of insecure protocols.
  • InsecureDefaultProtocol detect default constructions, this is no longer unsafe.