mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 02:21:13 +00:00
fix: Upgrade jsonwebtoken to address CVE-2022-23540 (#5116)
This commit is contained in:
committed by
GitHub
parent
0a5ab560b1
commit
97969fc815
@@ -72,7 +72,7 @@
|
||||
"@types/cookie-parser": "^1.4.2",
|
||||
"@types/express": "^4.17.6",
|
||||
"@types/json-diff": "^0.5.1",
|
||||
"@types/jsonwebtoken": "^8.5.2",
|
||||
"@types/jsonwebtoken": "^9.0.0",
|
||||
"@types/localtunnel": "^1.9.0",
|
||||
"@types/lodash.get": "^4.4.6",
|
||||
"@types/lodash.intersection": "^4.4.7",
|
||||
@@ -144,7 +144,7 @@
|
||||
"ioredis": "^5.2.4",
|
||||
"json-diff": "^0.5.4",
|
||||
"jsonschema": "^1.4.1",
|
||||
"jsonwebtoken": "^8.5.1",
|
||||
"jsonwebtoken": "^9.0.0",
|
||||
"jwks-rsa": "~1.12.1",
|
||||
"localtunnel": "^2.0.0",
|
||||
"lodash.get": "^4.4.2",
|
||||
|
||||
@@ -27,6 +27,7 @@ export function issueJWT(user: User): JwtToken {
|
||||
|
||||
const signedToken = jwt.sign(payload, config.getEnv('userManagement.jwtSecret'), {
|
||||
expiresIn: expiresIn / 1000 /* in seconds */,
|
||||
algorithm: 'HS256',
|
||||
});
|
||||
|
||||
return {
|
||||
@@ -57,7 +58,9 @@ export async function resolveJwtContent(jwtPayload: JwtPayload): Promise<User> {
|
||||
}
|
||||
|
||||
export async function resolveJwt(token: string): Promise<User> {
|
||||
const jwtPayload = jwt.verify(token, config.getEnv('userManagement.jwtSecret')) as JwtPayload;
|
||||
const jwtPayload = jwt.verify(token, config.getEnv('userManagement.jwtSecret'), {
|
||||
algorithms: ['HS256'],
|
||||
}) as JwtPayload;
|
||||
return resolveJwtContent(jwtPayload);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user