🐛 PUT-1656: stop an embedded fs: in a path from escalating to full FS access - #3666
Merged
Salazareo merged 1 commit intoAug 29, 2026
Conversation
The fs-path-to-uid permission rewriter split permission strings on the raw \`fs:\` substring instead of parsing on component boundaries. A path can itself contain \`fs:\` — a home dir named \`…fs\`, or \`fs\` in the mode position — and the raw split mistook that for the mode delimiter. Crafting \`fs:/<victim>fs:junk:read\` made the split do two things at once: it dropped the \`junk:read\` mode, and it consumed the trailing \`fs\`, turning the harmless-looking nonexistent path shown in the consent dialog into the victim's real home path. The rewriter then stored a bare \`fs:<home_uuid>\`, which subsumes every mode via parent-permission matching — full read+write+delete from a request the user saw as \`junk:read\`. Parse with PermissionUtil.split() in both matches() and rewrite(), matching every other permission parser, and locate the \`fs\` component by position (after an optional \`manage\` prefix). The path component is now exactly what sits between \`fs\` and the next unescaped colon, and all trailing components are preserved as the mode — so an embedded \`fs:\` is data, never a delimiter. The crafted input now addresses the nonexistent \`/<victim>fs\` and 404s. Regression tests pin both halves: the exact PoC must 404, and an \`fs:\` in the mode position must survive the rewrite instead of collapsing to a bare permission. Both fail on the old rewriter and pass on the fix.
Contributor
Coverage Report
File Coverage
|
||||||||||||||||||||||||||||||||||||||
Salazareo
approved these changes
Aug 29, 2026
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.
The fs-path-to-uid permission rewriter split permission strings on the raw `fs:` substring instead of parsing on component boundaries. A path can itself contain `fs:` — a home dir named `…fs`, or `fs` in the mode position — and the raw split mistook that for the mode delimiter.
Crafting `fs:/fs:junk:read` made the split do two things at once: it dropped the `junk:read` mode, and it consumed the trailing `fs`, turning the harmless-looking nonexistent path shown in the consent dialog into the victim's real home path. The rewriter then stored a bare `fs:<home_uuid>`, which subsumes every mode via parent-permission matching — full read+write+delete from a request the user saw as `junk:read`.
Parse with PermissionUtil.split() in both matches() and rewrite(), matching every other permission parser, and locate the `fs` component by position (after an optional `manage` prefix). The path component is now exactly what sits between `fs` and the next unescaped colon, and all trailing components are preserved as the mode — so an embedded `fs:` is data, never a delimiter. The crafted input now addresses the nonexistent `/fs` and 404s.
Regression tests pin both halves: the exact PoC must 404, and an `fs:` in the mode position must survive the rewrite instead of collapsing to a bare permission. Both fail on the old rewriter and pass on the fix.