mirror of
https://github.com/Terncode/pixel.horse.git
synced 2026-09-24 13:55:04 +02:00
Merge pull request #133 from BytewaveMLP/security-random-values
Update secret/token security checks
This commit is contained in:
@@ -58,15 +58,20 @@ export const args = argv as AppArgs;
|
|||||||
export const { version, description }: AppPackage = require('../../../package.json');
|
export const { version, description }: AppPackage = require('../../../package.json');
|
||||||
export const config: AppConfig = require('../../../config.json');
|
export const config: AppConfig = require('../../../config.json');
|
||||||
|
|
||||||
|
const INSECURE_RANDOM_VALUES = [
|
||||||
|
'gfhfdshtrdhgedryhe4t3y5uwjthr',
|
||||||
|
'sdlfgihsdor8ghor8dgdrgdegrdg',
|
||||||
|
'<some_random_string_here>',
|
||||||
|
'<some_other_random_string_here>',
|
||||||
|
];
|
||||||
|
|
||||||
if (!DEVELOPMENT && !TESTS &&
|
if (!DEVELOPMENT && !TESTS &&
|
||||||
(!config.secret || !config.token
|
(!config.secret || !config.token
|
||||||
|| config.secret.length < 16
|
|| config.secret.length < 16
|
||||||
|| config.token.length < 16
|
|| config.token.length < 16
|
||||||
|| config.secret === config.token
|
|| config.secret === config.token
|
||||||
|| config.secret === 'gfhfdshtrdhgedryhe4t3y5uwjthr'
|
|| INSECURE_RANDOM_VALUES.includes(config.secret)
|
||||||
|| config.token === 'sdlfgihsdor8ghor8dgdrgdegrdg'
|
|| INSECURE_RANDOM_VALUES.includes(config.token))) {
|
||||||
|| config.secret === '<some_random_string_here>'
|
|
||||||
|| config.token === '<some_random_string_here>')) {
|
|
||||||
console.error(
|
console.error(
|
||||||
`
|
`
|
||||||
================================================================================
|
================================================================================
|
||||||
|
|||||||
Reference in New Issue
Block a user