Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inaccurate message in hashlib check #827

Merged
merged 1 commit into from
Feb 26, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 6 additions & 7 deletions bandit/plugins/hashlib_insecure_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

:Example:

>> Issue: [B324:hashlib] Use of weak MD2, MD4, MD5, or SHA1 hash for
>> Issue: [B324:hashlib] Use of weak MD4, MD5, or SHA1 hash for
security. Consider usedforsecurity=False
Severity: High Confidence: High
CWE: CWE-327 (https://cwe.mitre.org/data/definitions/327.html)
Expand Down Expand Up @@ -62,8 +62,8 @@ def _hashlib_func(context):
severity=bandit.HIGH,
confidence=bandit.HIGH,
cwe=issue.Cwe.BROKEN_CRYPTO,
text="Use of weak MD2, MD4, MD5, or SHA1 hash "
"for security. Consider usedforsecurity=False",
text="Use of weak MD4, MD5, or SHA1 hash for "
"security. Consider usedforsecurity=False",
lineno=context.node.lineno,
)
elif func == "new":
Expand All @@ -78,8 +78,8 @@ def _hashlib_func(context):
severity=bandit.HIGH,
confidence=bandit.HIGH,
cwe=issue.Cwe.BROKEN_CRYPTO,
text="Use of weak MD2, MD4, MD5, or SHA1 hash "
"for security. Consider usedforsecurity=False",
text="Use of weak MD4, MD5, or SHA1 hash for "
"security. Consider usedforsecurity=False",
lineno=context.node.lineno,
)

Expand All @@ -103,8 +103,7 @@ def _hashlib_new(context):
severity=bandit.MEDIUM,
confidence=bandit.HIGH,
cwe=issue.Cwe.BROKEN_CRYPTO,
text="Use of insecure MD2, MD4, MD5, or SHA1 hash "
"function.",
text="Use of insecure MD4, MD5, or SHA1 hash function.",
lineno=context.node.lineno,
)

Expand Down