Allow browser preview for absolute file links outside project root #7027
HabsaTheDog
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Problem
T3 Code recognizes absolute Markdown links to generated HTML/PDF/image files, but opening a linked file outside the project root fails because the asset request is always authorized as a
workspace-file.Reproduction
Actual behavior
The integrated browser reports:
Expected behavior
Any regular previewable file referenced by an absolute path can be opened through a short-lived, exact-file asset capability. The capability must not expose sibling files, relative parent traversal must remain rejected, and existing workspace previews should retain their current behavior.
Environment
e6987965f659Root cause
openFileInPreviewsends every linked browser document asworkspace-file.AssetAccess.issueAssetUrlresolves absolute paths relative to the thread worktree/project root, so any external path becomes a parent traversal and is rejected before the signed asset URL is issued.A minimal fix can keep the current contract and route, validate an external file relative to its containing directory, and issue an exact-file capability. This allows the selected file without granting access to its directory or weakening relative traversal checks.
All reactions