Skip to content

High performance self-hosted photo and video management solution.

fix(deps): update dependency cookie to v2 (#31916)

renovate[bot]e505e5113b43
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 7f27785130..1b8597fc6e 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -659,8 +659,8 @@ importers:
specifier: ^1.8.0
version: 1.8.2([email protected])
cookie:
- specifier: ^1.0.2
- version: 1.1.1
+ specifier: ^2.0.0
+ version: 2.0.1
cookie-parser:
specifier: ^1.4.7
version: 1.4.7
@@ -6790,9 +6790,9 @@ packages:
resolution: {integrity: sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==}
engines: {node: '>= 0.6'}
- resolution: {integrity: sha512-ei8Aos7ja0weRpFzJnEA9UHJ/7XQmqglbRwnf2ATjcB9Wq874VKH9kfjjirM6UhU2/E5fFYadylyhFldcqSidQ==}
- engines: {node: '>=18'}
+ resolution: {integrity: sha512-yuToqVvRrj6pfDXREyQAAv8SkAEk/8GS3jQRTiUMm66TVtBYmqQeoEjL2Lmq8Rpo6271vH76InTChTitEAm65w==}
+ engines: {node: '>=22'}
resolution: {integrity: sha512-LDx6oHrK+PhzLKJU9j5S7/Y3jM/mUHvD/DeI1WQmJn652iPC5Y4TBzC9l+5OMOXlyTTA+SmVUPm0HQUwpD5Jqw==}
@@ -19785,7 +19785,7 @@ snapshots:
diff --git a/server/package.json b/server/package.json
index d83dee86b0..61479e86a9 100644
--- a/server/package.json
+++ b/server/package.json
@@ -71,7 +71,7 @@
"bullmq": "^6.0.0",
"chokidar": "^5.0.0",
"compression": "^1.8.0",
- "cookie": "^1.0.2",
+ "cookie": "^2.0.0",
"cookie-parser": "^1.4.7",
"cron": "4.4.0",
"exiftool-vendored": "^35.20.0",
diff --git a/server/src/maintenance/maintenance-worker.service.ts b/server/src/maintenance/maintenance-worker.service.ts
index e92afacaa6..415c16f8b6 100644
--- a/server/src/maintenance/maintenance-worker.service.ts
+++ b/server/src/maintenance/maintenance-worker.service.ts
@@ -1,5 +1,5 @@
import { Injectable, UnauthorizedException } from '@nestjs/common';
-import { parse } from 'cookie';
+import { parseCookie } from 'cookie';
import { NextFunction, Request, Response } from 'express';
import { jwtVerify } from 'jose';
import { readFileSync } from 'node:fs';
@@ -240,7 +240,7 @@ export class MaintenanceWorkerService {
}
async authenticate(headers: IncomingHttpHeaders): Promise<MaintenanceAuthDto> {
- const jwtToken = parse(headers.cookie || '')[ImmichCookie.MaintenanceToken];
+ const jwtToken = parseCookie(headers.cookie || '')[ImmichCookie.MaintenanceToken];
return this.login(jwtToken);
}
diff --git a/server/src/services/auth.service.ts b/server/src/services/auth.service.ts
index cd88499a85..1cb9e962c4 100644
--- a/server/src/services/auth.service.ts
+++ b/server/src/services/auth.service.ts
@@ -1,5 +1,5 @@
import { BadRequestException, ForbiddenException, Injectable, UnauthorizedException } from '@nestjs/common';
-import { parse } from 'cookie';
+import { parseCookie } from 'cookie';
import { DateTime } from 'luxon';
import { IncomingHttpHeaders } from 'node:http';
import sanitize from 'sanitize-filename';
@@ -482,17 +482,17 @@ export class AuthService extends BaseService {
}
private getCookieToken(headers: IncomingHttpHeaders): string | null {
- const cookies = parse(headers.cookie || '');
+ const cookies = parseCookie(headers.cookie || '');
return cookies[ImmichCookie.AccessToken] || null;
}
private getCookieOauthState(headers: IncomingHttpHeaders): string | null {
- const cookies = parse(headers.cookie || '');
+ const cookies = parseCookie(headers.cookie || '');
return cookies[ImmichCookie.OAuthState] || null;
}
private getCookieCodeVerifier(headers: IncomingHttpHeaders): string | null {
- const cookies = parse(headers.cookie || '');
+ const cookies = parseCookie(headers.cookie || '');
return cookies[ImmichCookie.OAuthCodeVerifier] || null;
}