Skip to content

Update file-type from ^16 to ^21.3.3 in @jimp/core#1400

Merged
hipstersmoothie merged 4 commits intojimp-dev:mainfrom
Kashkovsky:fix/update-file-type-v21
Apr 7, 2026
Merged

Update file-type from ^16 to ^21.3.3 in @jimp/core#1400
hipstersmoothie merged 4 commits intojimp-dev:mainfrom
Kashkovsky:fix/update-file-type-v21

Conversation

@Kashkovsky
Copy link
Copy Markdown
Contributor

Summary

Fixes #1399

Updates the file-type dependency in @jimp/core from ^16.0.0 to ^21.3.1 to address the security vulnerability GHSA-5v7r-6r5c-r473 (CVE-2024-4367), which affects file-type versions <16.5.4 and <18.7.0.

Changes

  • packages/core/package.json: Bump file-type from ^16.0.0 to ^21.3.1; remove deprecated @types/file-type dev dependency (types are now bundled in file-type itself)
  • packages/core/src/index.ts: Update import from default export (import fileType from "file-type/core.js") to named export (import { fileTypeFromBuffer } from "file-type/core.js"), and replace fileType.fromBuffer(...) with fileTypeFromBuffer(...)

Notes

  • file-type v21 is ESM-only, which is compatible with @jimp/core since it already uses "type": "module" and builds with tshy
  • The @types/file-type package is deprecated as file-type now ships its own type definitions
  • Only source files are modified; dist files should be rebuilt by maintainers

Addresses the security vulnerability in file-type <16.5.4 and <18.7.0
(GHSA-5v7r-6r5c-r473 / CVE-2024-4367) by upgrading to v21.

Changes:
- Update file-type dependency from ^16.0.0 to ^21.3.1
- Remove deprecated @types/file-type (types are now bundled)
- Update import from default export to named export (fileTypeFromBuffer)

Fixes jimp-dev#1399
Copy link
Copy Markdown
Contributor

@quanglam2807 quanglam2807 left a comment

Choose a reason for hiding this comment

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

Please merge this PR!

@aletcetera
Copy link
Copy Markdown

@hipstersmoothie would it be possible to take a look at this PR ? Thanks in advance!

@Kashkovsky Kashkovsky changed the title Update file-type from ^16 to ^21.3.1 in @jimp/core Update file-type from ^16 to ^21.3.3 in @jimp/core Mar 17, 2026
@Kashkovsky
Copy link
Copy Markdown
Contributor Author

The new file-type CVE has arrived while we’re waiting for the PR to be merged: GHSA-j47w-4g3g-c36v

Bumped file-type to 21.3.3

Comment thread packages/core/package.json Outdated
@quanglam2807
Copy link
Copy Markdown
Contributor

@crutchcorn pls review this PR.

@hipstersmoothie hipstersmoothie force-pushed the fix/update-file-type-v21 branch 2 times, most recently from 6688799 to 218ea58 Compare April 7, 2026 16:51
@hipstersmoothie hipstersmoothie force-pushed the fix/update-file-type-v21 branch from 218ea58 to 9d91eb2 Compare April 7, 2026 17:39
@hipstersmoothie hipstersmoothie merged commit e1bfa93 into jimp-dev:main Apr 7, 2026
5 checks passed
@hipstersmoothie
Copy link
Copy Markdown
Collaborator

🚀 PR was released in v1.6.1 🚀

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

Labels

released This issue/pull request has been released.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update file-type dependency to v21+ (GHSA-5v7r-6r5c-r473)

10 participants