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

Flask quickstarter is not protected from CSRF by default #636

Open
michaelsauter opened this issue Aug 9, 2021 · 4 comments
Open

Flask quickstarter is not protected from CSRF by default #636

michaelsauter opened this issue Aug 9, 2021 · 4 comments
Labels
enhancement New feature or request

Comments

@michaelsauter
Copy link
Member

A newly provisioned Flask quickstarter is immediately flagged by SonarQube:

Make sure disabling CSRF protection is safe here.

The recommended action is to change:

app = Flask(__name__)

to:

app = Flask(__name__)
csrf = CSRFProtect()
csrf.init_app(app)

@gerardcl @henrjk @buegelbeatz Do you see any issues doing that change?

@gerardcl
Copy link
Member

LGTM! shouldn't affect current behaviour nor tests 👍

@gerardcl
Copy link
Member

hi @michaelsauter ! could be that you tested this fix from here in the ods-pipeline? if that was successful I guess we can just promote it, right? do you want me to do that? everywhere?

@michaelsauter
Copy link
Member Author

@gerardcl I tried, but I failed ... CSRFProtect needs to be imported I think but I did not investigatee further as it is quite irrelevant for the ods-pipeline project as there is is only used in the tests.

@gerardcl
Copy link
Member

ok, will provide a fix for that then in ods-quickstarters so you can then import accordingly to ods-pipeline or I can do it too no prob 👍
next week though :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants