Skip to content

fix: constrain theme and image file paths - #249

Merged
alecdotdev merged 1 commit into
alecdotdev:masterfrom
PathGao:codex/harden-file-command-paths
Jul 29, 2026
Merged

fix: constrain theme and image file paths#249
alecdotdev merged 1 commit into
alecdotdev:masterfrom
PathGao:codex/harden-file-command-paths

Conversation

@PathGao

@PathGao PathGao commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Fixes #248.
Fixes #250.

Summary

  • Reject traversal, separators, and absolute paths in theme names and image path components.
  • Canonicalize image directories after creation and reject symlinked directories outside the document parent.
  • Prevent existing image symlinks from escaping the document parent.
  • Use atomic writes for application theme state, downloaded themes, and decoded image data.
  • Reject failed VSIX downloads and bound download size, archive entry count, expanded size, and manifest/theme JSON sizes.

Validation

  • project-local Cargo test: 4 passing Rust tests

@PathGao
PathGao force-pushed the codex/harden-file-command-paths branch 2 times, most recently from 15663dc to cef4105 Compare July 24, 2026 21:01
@PathGao
PathGao force-pushed the codex/harden-file-command-paths branch from cef4105 to 589f23d Compare July 28, 2026 05:39
@PathGao
PathGao marked this pull request as ready for review July 28, 2026 05:40
@PathGao

PathGao commented Jul 28, 2026

Copy link
Copy Markdown
Contributor Author

@alecdotdev #249 is ready as the first PR in a verified merge sequence.

I rebased it on current master, resolved the #228 overlap while preserving the CommonMark regression coverage, and verified cargo test (19 tests) plus npm run check.

The follow-up PRs are intentionally stacked and have been squash-merge simulated without conflicts in this order:

  1. fix: constrain theme and image file paths #249
  2. fix: ignore stale preview renders #254
  3. fix: guard viewer initialization after disposal #258
  4. fix: recover from interrupted session restores #260

Their GitHub CI is currently running. Once #249 is green, it can be merged first; please merge the remaining PRs in that order after their checks pass.

@PathGao

PathGao commented Jul 28, 2026

Copy link
Copy Markdown
Contributor Author

@alecdotdev Please hold the earlier merge sequence for a P0 regression: #264 reports a deterministic Windows release abort when fenced code contains multibyte-leading content. I opened #265 with the isolated scanner fix and a Rust reproduction test.

#265 should be reviewed and merged before #249. After it lands, I will rebase #249 and then rebuild the #249#254#258#260 sequence on the fixed master.

@alecdotdev
alecdotdev merged commit 1923889 into alecdotdev:master Jul 29, 2026
5 checks passed
alecdotdev added a commit that referenced this pull request Jul 29, 2026
@PathGao
PathGao deleted the codex/harden-file-command-paths branch July 29, 2026 07:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

security: bound VSIX theme downloads and archive expansion security: reject path traversal in theme and image file commands

2 participants