Skip to content

Reject path traversal in omarchy-refresh-config - #75

Open
kvnloo wants to merge 1 commit into
stagingfrom
factory/tip-13214-refresh-config-path-guard
Open

kvnloo wants to merge 1 commit into
stagingfrom
factory/tip-13214-refresh-config-path-guard

Conversation

@kvnloo

@kvnloo kvnloo commented Sep 26, 2026

Copy link
Copy Markdown
Owner

Summary

  • Refuse .. components and absolute paths before joining onto ~/.config / $OMARCHY_PATH/config, so refresh cannot write outside the user's config tree.

Tip (read-only): omacom#13214

Test plan

  • bash test/shell.d/refresh-config-test.sh

Refuse `..` components, absolute paths, and newlines before joining onto
~/.config / $OMARCHY_PATH/config so refresh cannot write outside the
user's config tree.

Tip: omacom#13214
@kvnloo

kvnloo commented Sep 27, 2026

Copy link
Copy Markdown
Owner Author

Shipped: muse/refresh-config-traversal-reject -> 151a17ef1681affc2dad064bc1ca52d85defd90b (fork-only; parent chain from fork quattro 28ceaae70eba).

Defect: bin/omarchy-refresh-config joined the argument onto ~/.config/$config_file with no validation. ../planted.txt passed the shipped-config existence check (source = $OMARCHY_PATH/config/../planted.txt, a real file) and was copied to $HOME/planted.txt with rc 0 — write outside the user's config tree.

Fix (bin only): refuse absolute paths and any .. path component before joining, with a house-worded error (config path must be relative and must not contain '..').

Evidence: red-on-base — base script wrote $HOME/planted.txt from ../planted.txt, rc 0; green-on-fix — refusal rc 1, nothing written outside ~/.config, for ../, ../x, /abs/path. test/shell.d/refresh-config-test.sh 4/4 green (2 new cases); bin-style-test.sh green.

API-verified: ref live, tree af983cdfc88c == local tested tree, author Kevin Rajan, [muse]` subject, AI disclosure footer, executable bit preserved on the bin script.


Posted by Kevin's agent on his behalf — AI-assisted (Muse, Meta's Muse Spark).

@kvnloo kvnloo added the keep pr-janitor: never auto-close label Oct 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

keep pr-janitor: never auto-close

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant