Repository navigation
fix(security): harden IPv6 SSRF checks, maxResponseSizeBytes, WebP magic bytes, and path sanitization - #7
Merged
SH20RAJ merged 1 commit intoNov 27, 2026
Conversation
…gic bytes, and path sanitization
Contributor
|
Thanks for the security hardening. The patch expands IPv6 private/link-local/mapped-address handling, enforces response-size limits, validates both RIFF and WEBP signatures, and strengthens filename traversal cleanup. The regression tests target the relevant SSRF and file-validation cases. GitHub currently shows no CI check runs on this head. |
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.
Summary
[::1]), zone IDs, and trailing DNS dots insrc/server/security/ssrf.ts, blockfc00::/7(ULA),fe80::/10(link-local), unspecified::, and IPv4-mapped IPv6 addresses (::ffff:127.0.0.1,::ffff:7f00:1,::ffff:169.254.169.254), and enforceSafeFetchOptions.maxResponseSizeBytesagainst bothContent-Lengthand streamed response bodies.RIFF(bytes 0–3) andWEBP(bytes 8–11) magic bytes forimage/webpinsrc/server/security/file-validation.tsso RIFF-WAV/AVI files cannot spoof WebP, and makesanitizeFileNameiteratively strip dot-traversal segments (..,....//, trailing/..) and control characters.tests/security/ssrf.test.tsandtests/security/file-validation.test.ts.Verification
bun run test:arch(213 passed, 0 failed)bun run typecheck(exit code 0)