-
Notifications
You must be signed in to change notification settings - Fork 6
Parent/Guardian Email Reset #594
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
base: projects-non-challenge
Are you sure you want to change the base?
Conversation
Indent and Reset code functional again Documentation Window now using Ivygate's Documentation Window Added Common Documentation
…for parent/guardian consent
| session({ | ||
| secret: config.server.sessionSecret || "kipr-simulator-session-secret", | ||
| resave: false, | ||
| saveUninitialized: true, | ||
| cookie: { | ||
| maxAge: 24 * 60 * 60 * 1000, // 24 hours | ||
| httpOnly: true, | ||
| secure: process.env.NODE_ENV === "production" ? true : false, // Enforce secure cookies in production | ||
| }, | ||
| name: "kipr_session", | ||
| }) |
Check warning
Code scanning / CodeQL
Clear text transmission of sensitive cookie Medium
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 12 days ago
To fix this issue, set the secure attribute of the session cookie to true, which ensures cookies are transmitted only over HTTPS connections. However, if you must support non-HTTPS in development, consider using a warning or, ideally, fail fast when NODE_ENV is not "production" and secure is disabled. The fix involves updating the cookie configuration in the session middleware in express.js (lines 39–43) to always use secure: true. If strict enforcement is problematic for development, output a clear warning when running in insecure mode, or support local development over HTTPS.
In summary:
- Update the cookie configuration in the session middleware to set
secure: true. - Optionally, log or throw an error if NODE_ENV is not "production" and HTTPS is not used.
- No method definitions or extra imports are needed beyond this configuration update.
-
Copy modified line R42
| @@ -39,7 +39,7 @@ | ||
| cookie: { | ||
| maxAge: 24 * 60 * 60 * 1000, // 24 hours | ||
| httpOnly: true, | ||
| secure: process.env.NODE_ENV === "production" ? true : false, // Enforce secure cookies in production | ||
| secure: true, // Always enforce secure cookies; transmits only over HTTPS | ||
| }, | ||
| name: "kipr_session", | ||
| }) |
Adds a button to the waiting page for parental/guardian consent for child to use the Simulator that allows for resetting of the parent/guardian email.