Open
Conversation
| import bleach | ||
| app = Flask(__name__) | ||
|
|
||
| app = Flask(__name__) # comment |
There was a problem hiding this comment.
CSRF protections disabled
File: flask.py | Checkov ID: CKV3_SAST_56
Description
CWE: CWE-352: Cross-Site Request Forgery (CSRF)
OWASP: A01:2021 - Broken Access Control
Cross-Site Request Forgery (CSRF) is an attack that forces a victim to execute unwanted actions on a web application they are authenticated with. By disabling CSRF protections, applications expose themselves to a serious security risk. This policy has identified instances where CSRF protections are disabled or not correctly implemented.
When CSRF protections are disabled, it can lead to:
- Unauthorized actions performed on behalf of an authenticated user.
- Data breaches.
- Account hijacking.
- Exploitation of the trust a user has with a specific site.
In the analyzed codebase, instances were detected where the CSRF protections were explicitly turned off. Such configurations increase the application's vulnerability to CSRF attacks.
For example, avoiding practices like:
# Disabling CSRF protection in Flask-WTF
class MyForm(flask_wtf.FlaskForm):
class Meta:
csrf = False
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.