Beyond the curated attacks, the conformance harness feeds the entire
reflection-class spec surface - 387 escape sequences - to secure-terminal in CLI mode and
checks three invariants on every one. These are the query and report sequences a terminal
historically answers, and answering them is the "output becomes input" bug class; each is
documented in the
XTerm Control Sequences
reference:
- the primary, secondary and tertiary
device-attribute queries
(
DA1/DA2/DA3);
- DECRQSS (request a
setting the program just set), and the
XTVERSION
and XTGETTCAP
name/version and terminfo queries;
- the cursor-position and device-status reports
(DSR/CPR),
and ENQ answerback;
- the window-size/position and palette/colour queries.
The class, and why answering any of them is dangerous, is laid out in David
Leadbeater's 2023 terminal-security review.
On each sequence the harness checks:
i. Nothing is written back to the pty. A vulnerable terminal answers a query by
writing its reply onto the same channel - which is the program's keyboard. secure-terminal
must write zero bytes back, for every query. This is the whole "output becomes
input" attack class, closed and asserted.
ii. Nothing non-ASCII is smuggled to the screen. The rendered text may contain only
printable ASCII plus tab, newline, and the documented line-local cursor controls
(backspace and carriage return, plus the effect of CSI C/D/G/K, all clamped to the
line being written). Any other control byte, or any codepoint above 0x7e
(the invisible / bidi / homoglyph classes), is a violation.
iii. Nothing crashes. Every sequence must render in bounded time without an exception,
including deliberately malformed and over-long ones.
The harness checks itself, too. A
positive control feeds a deliberately-vulnerable result and asserts the check FLAGS it;
a negative control runs the same predicate over a known-bad terminal to prove the check
can actually detect a failure. And a dedicated check asserts that CLI mode never even
instantiates the pyte screen engine - so there is no VT state machine to attack in the default
mode. A test that cannot fail proves nothing; these can.