Files
deepseek-harness/packages/code-runtime/code-runtime-python/src
Chinesezjc 6bdbe71092 fix(code-runtime-python): drop fd-3 frames with illegal UTF-8 instead of mangling them
The reviewer's standing issue: line.toString('utf8') silently replaces illegal
bytes with U+FFFD, so a forged frame could land a corrupted completion value
(the honest child's lossless encoder never emits non-UTF-8, so such a frame is
hostile traffic). The fd-3 frame decode now uses a fatal UTF-8 decoder: an
illegal byte throws and the frame is dropped, same treatment as the
unsafe-integer check. A forged illegal-UTF-8 done frame is verified to be
dropped (the run settles on the program's real return), and reverting to
toString makes the case fail.
2026-08-31 15:04:43 +08:00
..