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

Implement CSRF protection #1351

Merged
merged 54 commits into from
Apr 3, 2024
Merged

Conversation

awidener3
Copy link
Contributor

@awidener3 awidener3 commented Jan 22, 2024

Include CSRF protection in Roosevelt applications

  • CSRF protection is enabled by default.
  • CSRF can only be fully disabled by disabling express-session (added with Add express-session dependency #1341).
  • Developers can switch between full (default) and manual. manual allows the dev to specify which routes are protected.
  • The README has been updated to educate devs on how to include a CSRF token in their POST requests.

closes #27

closes #1244

@awidener3
Copy link
Contributor Author

@kethinov I'm not 100% sold on my decision of using full vs. manual as configuration options. Any suggestions or thoughts?

@awidener3 awidener3 marked this pull request as ready for review January 29, 2024 20:30
Copy link

codecov bot commented Mar 4, 2024

Codecov Report

Attention: Patch coverage is 28.00000% with 144 lines in your changes are missing coverage. Please review.

Project coverage is 83.44%. Comparing base (b4c5091) to head (d89f43c).

Files Patch % Lines
lib/setExpressConfigs.js 14.51% 53 Missing ⚠️
lib/scripts/certsGenerator.js 0.00% 45 Missing ⚠️
lib/scripts/csrfSecretGenerator.js 13.33% 39 Missing ⚠️
roosevelt.js 50.00% 7 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1351      +/-   ##
==========================================
- Coverage   87.32%   83.44%   -3.88%     
==========================================
  Files          25       26       +1     
  Lines        3590     3758     +168     
==========================================
+ Hits         3135     3136       +1     
- Misses        455      622     +167     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

README.md Outdated Show resolved Hide resolved
lib/setExpressConfigs.js Outdated Show resolved Hide resolved
@kethinov kethinov merged commit 7a4022c into rooseveltframework:main Apr 3, 2024
4 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Upgrade dev_sync.sh to a smarter Node.js-based script CSRF support
2 participants