Skip to content

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

Open
Kashkovsky wants to merge 1 commit intojimp-dev:mainfrom
Kashkovsky:fix/update-file-type-v21
Open

Update file-type from ^16 to ^21.3.1 in @jimp/core#1400
Kashkovsky wants to merge 1 commit intojimp-dev:mainfrom
Kashkovsky:fix/update-file-type-v21

Conversation

@Kashkovsky
Copy link

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

@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

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

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.

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

7 participants