Skip to content

Update file-type to 18.2.0#8304

Merged
dcousens merged 14 commits into
mainfrom
image-type-upgrade
Feb 27, 2023
Merged

Update file-type to 18.2.0#8304
dcousens merged 14 commits into
mainfrom
image-type-upgrade

Conversation

@dcousens
Copy link
Copy Markdown
Member

@dcousens dcousens commented Feb 14, 2023

This pull request mitigates CVE-2022-36313 by upgrading and using file-type directly.

The image-type package wraps file-type and then limits the returned result to a subset of filename extensions.
In our usage, we then limited the return of image-type to a smaller subset of filename extensions.
Knowing this, we have omitted the image-type package and used file-type directly.

Unfortunately we don't have static ESM imports at this time, as a result we are kind of hacking around this for now.
Rather than not mitigate the security vulnerability, I have opted for this as a temporary solution to move forward.

The tests require NODE_OPTIONS=--experimental-vm-modules, but on GitHub CI, jest is failing with a segmentation fault for that configuration. To pass CI, this pull request disables the test for now, so we can move forward with resolving the security vulnerability. You can run the tests locally using NODE_OPTIONS=--experimental-vm-modules with success.

@dcousens dcousens requested a review from borisno2 February 14, 2023 00:10
@dcousens dcousens self-assigned this Feb 14, 2023
@changeset-bot

This comment was marked as resolved.

@vercel
Copy link
Copy Markdown

vercel Bot commented Feb 14, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated
keystone-next-docs ⬜️ Ignored (Inspect) Visit Preview Feb 27, 2023 at 2:35AM (UTC)

@codesandbox-ci
Copy link
Copy Markdown

codesandbox-ci Bot commented Feb 14, 2023

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 1ed726d:

Sandbox Source
@keystone-6/sandbox Configuration

@vercel vercel Bot temporarily deployed to Preview February 14, 2023 00:17 Inactive
@vercel vercel Bot temporarily deployed to Preview February 14, 2023 00:40 Inactive
@vercel vercel Bot temporarily deployed to Preview February 14, 2023 00:55 Inactive
@vercel vercel Bot temporarily deployed to Preview February 14, 2023 00:58 Inactive
@vercel vercel Bot temporarily deployed to Preview February 14, 2023 01:15 Inactive
@vercel vercel Bot temporarily deployed to Preview February 14, 2023 03:00 Inactive
@vercel vercel Bot temporarily deployed to Preview February 14, 2023 03:31 Inactive
@dcousens dcousens changed the title Upgrade to [email protected] Upgrade to [email protected] (by using file-type directly) Feb 23, 2023
@dcousens dcousens changed the title Upgrade to [email protected] (by using file-type directly) Update file-type to 18.2.0 Feb 23, 2023
@dcousens dcousens merged commit aad6314 into main Feb 27, 2023
@dcousens dcousens deleted the image-type-upgrade branch February 27, 2023 03:45
Comment thread tsconfig.json
"noUnusedLocals": true,
"types": ["@types/jest"],
"typeRoots": [],
"skipLibCheck": false,
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunate, but hopefully only temporary

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants