Audit
extends-custom-expression
extends-custom-expression
Found extension of custom expression: $CLASS. Extending expressions in this way could inadvertently lead to a SQL injection vulnerability, which can result in attackers exfiltrating sensitive data. Instead, ensure no user input enters this function or that user input is properly sanitized.
Likelihood: LOW
Confidence: LOW
CWE:
- CWE-89: Improper Neutralization of Special Elements used in an SQL Command (‘SQL Injection’)
OWASP:
- A01:2017 - Injection
- A03:2021 - Injection
no-csrf-exempt
no-csrf-exempt
Detected usage of @csrf_exempt, which indicates that there is no CSRF token set for this route. This could lead to an attacker manipulating the user’s account and exfiltration of private data. Instead, create a function without this decorator.
Likelihood: LOW
Confidence: LOW
CWE:
- CWE-352: Cross-Site Request Forgery (CSRF)
OWASP:
- A01:2021 - Broken Access Control
unvalidated-password
unvalidated-password
The password on ‘$MODEL’ is being set without validating the password. Call django.contrib.auth.password_validation.validate_password() with validation functions before setting the password. See https://docs.djangoproject.com/en/3.0/topics/auth/passwords/ for more information.
Likelihood: LOW
Confidence: LOW
CWE:
- CWE-521: Weak Password Requirements
OWASP:
- A07:2021 - Identification and Authentication Failures
avoid-mark-safe
avoid-mark-safe
‘mark_safe()’ is used to mark a string as “safe” for HTML output. This disables escaping and could therefore subject the content to XSS attacks. Use ‘django.utils.html.format_html()’ to build HTML for rendering instead.
Likelihood: LOW
Confidence: LOW
CWE:
- CWE-79: Improper Neutralization of Input During Web Page Generation (‘Cross-site Scripting’)
OWASP:
- A07:2017 - Cross-Site Scripting (XSS)
- A03:2021 - Injection
avoid-query-set-extra
avoid-query-set-extra
QuerySet.extra’ does not provide safeguards against SQL injection and requires very careful use. SQL injection can lead to critical data being stolen by attackers. Instead of using ‘.extra’, use the Django ORM and parameterized queries such as People.objects.get(name='Bob')
.
Likelihood: LOW
Confidence: LOW
CWE:
- CWE-89: Improper Neutralization of Special Elements used in an SQL Command (‘SQL Injection’)
OWASP:
- A01:2017 - Injection
- A03:2021 - Injection
avoid-raw-sql
avoid-raw-sql
Detected the use of ‘RawSQL’ or ‘raw’ indicating the execution of a non-parameterized SQL query. This could lead to a SQL injection and therefore protected information could be leaked. Instead, use Django ORM and parameterized queries before raw SQL. An example of using the Django ORM is: People.objects.get(name='Bob')
Likelihood: LOW
Confidence: LOW
CWE:
- CWE-89: Improper Neutralization of Special Elements used in an SQL Command (‘SQL Injection’)
OWASP:
- A01:2017 - Injection
- A03:2021 - Injection
custom-expression-as-sql
custom-expression-as-sql
Detected a Custom Expression ”$EXPRESSION” calling ”as_sql(…).” This could lead to SQL injection, which can result in attackers exfiltrating sensitive data. Instead, ensure no user input enters this function or that user input is properly sanitized.
Likelihood: LOW
Confidence: LOW
CWE:
- CWE-89: Improper Neutralization of Special Elements used in an SQL Command (‘SQL Injection’)
OWASP:
- A01:2017 - Injection
- A03:2021 - Injection
django-secure-set-cookie
django-secure-set-cookie
avoid-insecure-deserialization
avoid-insecure-deserialization
Avoid using insecure deserialization library, backed by pickle
, _pickle
, cpickle
, dill
, shelve
, or yaml
, which are known to lead to remote code execution vulnerabilities.
Likelihood: MEDIUM
Confidence: MEDIUM
CWE:
- CWE-502: Deserialization of Untrusted Data
OWASP:
- A08:2017 - Insecure Deserialization
- A08:2021 - Software and Data Integrity Failures