Skip to content

Refuse font names that inject terminal config - #10804

Closed
chessing234 wants to merge 6 commits into
omacom:quattrofrom
chessing234:security/font-set-escape-terminals
Closed

chessing234 wants to merge 6 commits into
omacom:quattrofrom
chessing234:security/font-set-escape-terminals

Conversation

@chessing234

@chessing234 chessing234 commented Sep 8, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • omarchy-font-set interpolated the family into Alacritty, Ghostty, Foot, and Kitty with almost no escaping (Kitty only escaped \\&/).
  • A font whose fc-list name contains quotes, $, or XML metacharacters can close those rewrites and inject a second setting.
  • Unsafe names are refused before fc-list, and the remaining names are sed-escaped for every terminal rewrite.

This does not change fonts.conf; that XML path is already covered elsewhere.

Test plan

  • test/shell.d/font-set-terminal-injection-test.sh (GNU sed / Arch)
  • Set a normal Nerd Font and confirm terminals pick it up
  • omarchy-font-set 'Evil"; command = "id' is refused and configs are unchanged

A quoted family closed the Alacritty/Ghostty string and could inject a
second setting. Foot sed was unescaped the same way.
Those break sed and expand in double-quoted rewrites the same way quotes do.
Otherwise those cases fail at the missing-font check and never hit the
metacharacter guard.
A newline in the family never needs a fontconfig lookup, and the test
must not depend on grep -F matching across two output lines.
chessing234 added a commit to chessing234/omarchy that referenced this pull request Sep 16, 2026
…family lookup

Fold omacom#10285 and omacom#10804 into the omacom#10811 branch so one PR covers escaping,
injection refusal, and family-scoped font lookup.
@chessing234

Copy link
Copy Markdown
Contributor Author

folded into #10811.

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.

1 participant