Skip to content

OTWO-7713 CWE-1021: Clickjacking — X-Frame-Options and CSP frame-ance… - #1942

Open
Niharika1117 wants to merge 2 commits into
stagingfrom
OTWO-7713
Open

OTWO-7713 CWE-1021: Clickjacking — X-Frame-Options and CSP frame-ance…#1942
Niharika1117 wants to merge 2 commits into
stagingfrom
OTWO-7713

Conversation

@Niharika1117

Copy link
Copy Markdown
Contributor

…stors headers missing, login page embeds in external iframe

…stors headers missing, login page embeds in external iframe

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds clickjacking protections for authentication/session and account-related endpoints by ensuring frame-embedding is restricted via X-Frame-Options and CSP frame-ancestors.

Changes:

  • Adds a Rails initializer that patches Clearance::SessionsController to apply clickjacking headers on /sessions/new and DELETE /sessions.
  • Adds an after_action on AccountsController to apply the same clickjacking headers to account pages.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
config/initializers/clearance_session_security.rb Hooks into Clearance::SessionsController to set XFO + CSP frame-ancestors for session endpoints that bypass the app’s controller subclass.
app/controllers/accounts_controller.rb Adds an after_action and helper method to apply the same anti-clickjacking headers to account pages.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread config/initializers/clearance_session_security.rb
Comment thread app/controllers/accounts_controller.rb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants