qwen-code Bug: Non-UTF-8 Bytes Collapse to U+FFFD, Bypassing Shell Path Guards
yiliang114 · ghdev · 2026-11-09
QwenLM/qwen-code issue #16757 (P2, security) reports that the coding agent's shell permission guard decodes ANSI-C ($'…') words via Buffer.from(bytes).toString('utf8'), collapsing invalid UTF-8 bytes to U+FFFD, so the analyzer matches a different path than the one bash actually opens. Since Linux filenames are raw byte sequences, this is a permission-matching gap, not just a display bug.
- Verified on bash 5.3.20: inputs like $'\uD800', $'\uDFFF', $'\xff' all collapse to U+FFFD.
- Affected decoders: decodeAnsiCEscape/decodeAnsiCWord and flushAnsiC.
- Suggested fix: compare exact bytes bash would use, or fail-closed (ask the user) for words whose bytes can't be represented losslessly.
More from coding & agent
- Gemini /teamwork agents caught live: four parallel task logs all running that second — RyanSpunk · 2026-11-13
- Codex CLI 0.168.0 adds model provider picker, side-by-side TUI workspace and animated GIF generation — github-actions[bot] · 2026-11-13
- Free MCP server lets Claude read Altium, Allegro, KiCad and Gerber PCB files directly — woodisruff · 2026-11-13
- a16z Partner Clones Open-Source Game with Fable 5.2 Agent, Which Finds Its Own Horse Animation Asset — FinanceYF5 · 2026-11-13
- OpenAI team shares how it runs and governs fleets of persistent agents internally — romainhuet · 2026-11-13
- Perplexity's Decider scanned 1B tokens across 7,000 agent sessions, found 14 security fixes — denisyarats · 2026-11-13