Reference: docs/issues/safe-bash-security-audit-v2.md (Medium finding M12)
M12. cut -c silently strips a leading BOM from any line — BOM_CAPTURE fix incomplete at the command layer
text.ts:331 — per-line new TextDecoder() (ignoreBOM:false). The shell-level fix
(shell.ts:304-305, ignoreBOM:true) is intact, but command-internal decoders were left at
default. PoC: 41 0a ef bb bf 42 0a → cut -c 1-2 emits 41 0a 42 (mid-file BOM bytes
deleted); cut -b is correct. Same decoder class (BOM-blind, not byte-corrupting):
search/rg.ts:24, yq/index.ts:389, file/classify.ts:80, html-to-markdown/input.ts:77.
Fix: ignoreBOM:true at text.ts:331 + audit the listed decoders.
Reference: docs/issues/safe-bash-security-audit-v2.md (Medium finding M12)
M12.
cut -csilently strips a leading BOM from any line — BOM_CAPTURE fix incomplete at the command layertext.ts:331— per-linenew TextDecoder()(ignoreBOM:false). The shell-level fix(
shell.ts:304-305,ignoreBOM:true) is intact, but command-internal decoders were left atdefault. PoC:
41 0a ef bb bf 42 0a→cut -c 1-2emits41 0a 42(mid-file BOM bytesdeleted);
cut -bis correct. Same decoder class (BOM-blind, not byte-corrupting):search/rg.ts:24,yq/index.ts:389,file/classify.ts:80,html-to-markdown/input.ts:77.Fix:
ignoreBOM:trueattext.ts:331+ audit the listed decoders.