From 2f28498e5b943cee859ac513b838d1d6198510cd Mon Sep 17 00:00:00 2001 From: Kayne Ruse Date: Tue, 11 Jun 2019 23:53:36 +1000 Subject: [PATCH] HOTFIX problem --- public/news/2019-06-11-03.md | 6 ++++++ server/accounts.js | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 public/news/2019-06-11-03.md diff --git a/public/news/2019-06-11-03.md b/public/news/2019-06-11-03.md new file mode 100644 index 0000000..51cc642 --- /dev/null +++ b/public/news/2019-06-11-03.md @@ -0,0 +1,6 @@ +Hacking Attempts +--- +_11 June 2019_ + +A hacking attempt was witnessed, and a security hole has been patched. Please log out and log back in to fix any errors you are currently having. + diff --git a/server/accounts.js b/server/accounts.js index 4dd1ead..11a53b8 100644 --- a/server/accounts.js +++ b/server/accounts.js @@ -216,7 +216,7 @@ const loginRequest = (connection) => (req, res) => { } //create the new session - let rand = Math.floor(Math.random() * 100000); + let rand = Math.floor(Math.random() * Number.MAX_SAFE_INTEGER); let query = 'INSERT INTO sessions (accountId, token) VALUES (?, ?);'; connection.query(query, [results[0].id, rand], (err) => {