Skip to content

Tighten applicant response, redirect and profile link validation, and session cookie options - #142

Open
IanCou wants to merge 3 commits into
masterfrom
fix/security-quick-wins
Open

IanCou wants to merge 3 commits into
masterfrom
fix/security-quick-wins

Conversation

@IanCou

@IanCou IanCou commented Nov 14, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Stop logging the Authentik request config in AuthentikClient.
  • verifyotpsession now returns only the fields the applicant portal displays (ATSDashboard.tsx reads exactly these) via toApplicantApplication.
  • return_to and redirect_uri on login are resolved against the server's own origin (resolveSameOriginPath); anything else falls back to /.
  • Applicant LinkedIn and GitHub links are checked with a shared isAllowedProfileLink helper (https, expected host) on both apply and profile update, and the recruitment board only opens https links with noopener,noreferrer.
  • Session cookie: SameSite=Lax, Secure in production, 24h max age, saveUninitialized: false. The urlencoded body parser is removed; nothing in the server or webui posts form bodies.

Behavior notes

  • External redirect_uri passthrough (used by the API docs shim for same-origin only) no longer redirects off-site.
  • Redis session store is not part of this PR.

Testing

  • tsc --noEmit clean, Prettier clean on changed files.
  • Server unit suite: 164/164 (new: auth-redirects.test.js, profile-links.test.js).
  • No test added for the app.ts cookie options, since app.ts cannot be imported without starting the server. Moving the options to src/config/session.ts would allow that.

Stop printing the Authentik request config, return only the fields the applicant portal displays from verifyotpsession, and only follow same-origin return_to and redirect_uri targets.
Require https and a LinkedIn or GitHub host on both server paths, and only open https links from the recruitment board.
SameSite=Lax, Secure in production, 24h max age, no empty sessions, and no urlencoded parsing.
Copilot AI balanced review requested due to automatic review settings November 14, 2026 07:05

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.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

This branch has not been deployed

No deployments
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