chore(deps): update dependency file-type to v21.3.2 [security]#1010
Open
renovate[bot] wants to merge 1 commit intomasterfrom
Open
chore(deps): update dependency file-type to v21.3.2 [security]#1010renovate[bot] wants to merge 1 commit intomasterfrom
renovate[bot] wants to merge 1 commit intomasterfrom
Conversation
|
|
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
ecd55ef to
878521a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
21.3.1→21.3.2GitHub Vulnerability Alerts
CVE-2026-32630
Summary
A crafted ZIP file can trigger excessive memory growth during type detection in
file-typewhen usingfileTypeFromBuffer(),fileTypeFromBlob(), orfileTypeFromFile().In affected versions, the ZIP inflate output limit is enforced for stream-based detection, but not for known-size inputs. As a result, a small compressed ZIP can cause
file-typeto inflate and process a much larger payload while probing ZIP-based formats such as OOXML. In testing onfile-type21.3.1, a ZIP of about255 KBcaused about257 MBof RSS growth duringfileTypeFromBuffer().This is an availability issue. Applications that use these APIs on untrusted uploads can be forced to consume large amounts of memory and may become slow or crash.
Root Cause
The ZIP detection logic applied different limits depending on whether the tokenizer had a known file size.
For stream inputs, ZIP probing was bounded by
maximumZipEntrySizeInBytes(1 MiB). For known-size inputs such as buffers, blobs, and files, the code instead usedNumber.MAX_SAFE_INTEGERin two relevant places:and:
Together, these checks allowed a crafted ZIP to bypass the intended inflate limit for known-size APIs and force large decompression during detection of entries such as
[Content_Types].xml.Proof of Concept
Observed on
file-type21.3.1:255 KB257 MBAffected APIs
Affected:
fileTypeFromBuffer()fileTypeFromBlob()fileTypeFromFile()Not affected:
fileTypeFromStream(), which already enforced the ZIP inflate limit for unknown-size inputsImpact
Applications that inspect untrusted uploads with
fileTypeFromBuffer(),fileTypeFromBlob(), orfileTypeFromFile()can be forced to consume excessive memory during ZIP-based type detection. This can degrade service or lead to process termination in memory-constrained environments.Cause
The issue was introduced in 399b0f1
Release Notes
sindresorhus/file-type (file-type)
v21.3.2Compare Source
a155cd7370ed91Configuration
📅 Schedule: Branch creation - "" (UTC), Automerge - At any time (no schedule defined).
🚦 Automerge: Enabled.
♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.