Skip to content

Conversation

@Ushcode
Copy link
Member

@Ushcode Ushcode commented Feb 14, 2025

Potential fix for https://github.com/TheWorldAvatar/viz/security/code-scanning/3

To fix the problem, we need to ensure that the session cookie is only transmitted over secure connections by setting the secure attribute to true. This can be done by modifying the session configuration to include the secure attribute. Additionally, we should set the httpOnly attribute to prevent client-side scripts from accessing the cookie, further enhancing security.

  • Modify the session configuration in the server.use(session({... block to include the secure and httpOnly attributes.
  • Ensure that the secure attribute is conditionally set based on the environment (e.g., only set to true in production).

Suggested fixes powered by Copilot Autofix. Review carefully before merging.

@Ushcode Ushcode marked this pull request as ready for review April 25, 2025 16:37
Copy link
Member Author

@Ushcode Ushcode left a comment

Choose a reason for hiding this comment

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

  • NB this is a breaking change for deployments. It is now necessary to generate a unique SESSION_SECRET variable on the server before a production deployment with keycloak. See auth section of the main docs for guidance.
  • Address security vulnerability 3
  • Address security vulnerability 5

@Ushcode Ushcode self-assigned this Apr 25, 2025
@Ushcode Ushcode requested a review from gpeb2 May 6, 2025 10:27
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