mirror of
https://github.com/wg-easy/wg-easy.git
synced 2025-10-20 22:30:45 +08:00
fixes: security stuff (#47)
Insecure randomness (high) gravatar: md5 insecure hash algorithm (high) Clear text transmission of sensitive cookie (medium)
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
const path = require('path');
|
||||
const bcrypt = require('bcryptjs');
|
||||
const crypto = require('node:crypto');
|
||||
|
||||
const express = require('express');
|
||||
const expressSession = require('express-session');
|
||||
@@ -27,9 +28,10 @@ module.exports = class Server {
|
||||
.use('/', express.static(path.join(__dirname, '..', 'www')))
|
||||
.use(express.json())
|
||||
.use(expressSession({
|
||||
secret: String(Math.random()),
|
||||
secret: crypto.randomBytes(256).toString('hex'),
|
||||
resave: true,
|
||||
saveUninitialized: true,
|
||||
secure: true,
|
||||
}))
|
||||
|
||||
.get('/api/release', (Util.promisify(async () => {
|
||||
|
Reference in New Issue
Block a user