Repository navigation
fix(#379): Security (low): names containing U+FFFD are created by every write path but hidd - #391
Merged
Merged
Conversation
Home paths now refuse U+FFFD with PATH_INVALID through a new normalizeHomePath used by resolveInRoot and the whole local backend (PUT, tus, mkdir, move/copy/rename, WebDAV, transfers, archive import, share writes), and file-request visitor and uploader names drop it, so nothing can be planted that the listing, the ZIP export or the reindex hide; cloud sources keep such names addressable (adversarial review found the global regex broke cloud reads). The web's rename, new-folder, name-rules and migration name checks refuse U+FFFD through a shared hasUnsafeChar with the reworded inline message in all three locales; DECISIONS.md amended. Reviews run: adversarial (led to the home-only scope and the name-rules/migrate checks) and test adversary (no blocking findings; added on-disk and no-request assertions). Refs #379 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Author
|
Security review (claude-fable-5-1): no blocking finding. Fix is sound: all home writes pass through normalizeHomePath via LocalBackend.abs(); lone surrogates already rejected by isWellFormed()/toWellFormed(); sanitiser strips U+FFFD after toWellFormed(); tests fail when either guard is removed. Pre-existing U+FFFD ghosts on disk are not cleaned up (restore of such a trash row now fails PATH_INVALID); copyTree still carries unaddressable legacy names along in folder copies. |
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.
Refs #379
Home paths now refuse U+FFFD with PATH_INVALID through a new normalizeHomePath used by resolveInRoot and the whole local backend (PUT, tus, mkdir, move/copy/rename, WebDAV, transfers, archive import, share writes), and file-request visitor and uploader names drop it, so nothing can be planted that the listing, the ZIP export or the reindex hide; cloud sources keep such names addressable (adversarial review found the global regex broke cloud reads). The web's rename, new-folder, name-rules and migration name checks refuse U+FFFD through a shared hasUnsafeChar with the reworded inline message in all three locales; DECISIONS.md amended. Reviews run: adversarial (led to the home-only scope and the name-rules/migrate checks) and test adversary (no blocking findings; added on-disk and no-request assertions).
Driver gates (measured, not claimed)
red/green output
🤖 Generated with Claude Code