Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CVE-2023-26136] [1.3] Resolve tough-cookie to 4.1.3 #4682

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Add tough-cookie as explicit dev dep and update tests
Partial backport of #1113

Signed-off-by: Josh Romero <rmerqg@amazon.com>
  • Loading branch information
joshuarrrr committed Aug 4, 2023
commit 3e8c4112f6c52bd94c6499c160c84c413185adb8
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,7 @@
"@types/tar": "^4.0.3",
"@types/testing-library__jest-dom": "^5.9.3",
"@types/testing-library__react-hooks": "^3.4.0",
"@types/tough-cookie": "^4.0.1",
"@types/type-detect": "^4.0.1",
"@types/uuid": "^3.4.4",
"@types/vinyl": "^2.0.4",
Expand Down Expand Up @@ -486,6 +487,7 @@
"supertest-as-promised": "^4.0.2",
"tape": "^5.0.1",
"topojson-client": "3.0.0",
"tough-cookie": "^4.1.3",
"tree-kill": "^1.2.2",
"typescript": "4.0.2",
"ui-select": "0.19.8",
Expand Down
6 changes: 3 additions & 3 deletions src/core/server/http/cookie_session_storage.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
* Modifications Copyright OpenSearch Contributors. See
* GitHub history for details.
*/
import request from 'request';
import { parse as parseCookie } from 'tough-cookie';
import supertest from 'supertest';
import { REPO_ROOT } from '@osd/dev-utils';
import { ByteSizeValue } from '@osd/config-schema';
Expand Down Expand Up @@ -107,7 +107,7 @@ interface Storage {
}

function retrieveSessionCookie(cookies: string) {
const sessionCookie = request.cookie(cookies);
const sessionCookie = parseCookie(cookies);
if (!sessionCookie) {
throw new Error('session cookie expected to be defined');
}
Expand Down Expand Up @@ -487,7 +487,7 @@ describe('Cookie based SessionStorage', () => {
expect(cookies).toHaveLength(1);

const sessionCookie = retrieveSessionCookie(cookies[0]);
expect(sessionCookie.extensions).toContain(`SameSite=${sameSite}`);
expect(sessionCookie.sameSite).toEqual(sameSite.toLowerCase());

await supertest(innerServer.listener)
.get('/')
Expand Down
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3435,6 +3435,11 @@
resolved "https://registry.yarnpkg.com/@types/tough-cookie/-/tough-cookie-2.3.5.tgz#9da44ed75571999b65c37b60c9b2b88db54c585d"
integrity sha512-SCcK7mvGi3+ZNz833RRjFIxrn4gI1PPR3NtuIS+6vMkvmsGjosqTJwRt5bAEFLRz+wtJMWv8+uOnZf2hi2QXTg==

"@types/tough-cookie@^4.0.1":
version "4.0.2"
resolved "https://registry.yarnpkg.com/@types/tough-cookie/-/tough-cookie-4.0.2.tgz#6286b4c7228d58ab7866d19716f3696e03a09397"
integrity sha512-Q5vtl1W5ue16D+nIaW8JWebSSraJVlK+EthKn7e7UcD4KWsaSJ8BqGPXNaPghgtcn/fhvrN17Tv8ksUsQpiplw==

"@types/type-detect@^4.0.1":
version "4.0.1"
resolved "https://registry.yarnpkg.com/@types/type-detect/-/type-detect-4.0.1.tgz#3b0f5ac82ea630090cbf57c57a1bf5a63a29b9b6"
Expand Down