THE FOLD / BOSS / THE GATEKEEPER / THE BIDI OVERRIDE
THE BIDI OVERRIDE
two readers, two orders, no error
1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION
Text has a logical order — the order the bytes are in — and a display order. Nine invisible characters let you set the second without touching the first, so a line of code can be shown in an order it does not have.
LIT verified live. there are 9 bidirectional control characters: U+202A to U+202E and U+2066 to U+2069. All 9 belong to Unicode’s format category, all 9 are a single code unit, and all 9 draw nothing. A source line carrying 2 of them measures 35 code points of which 33 are visible — the compiler reads all 35 in byte order, the reviewer reads 33 in display order, and the two orders are not the same.
LIT verified live. there are 9 bidirectional control characters: U+202A to U+202E and U+2066 to U+2069. All 9 belong to Unicode’s format category, all 9 are a single code unit, and all 9 draw nothing. A source line carrying 2 of them measures 35 code points of which 33 are visible — the compiler reads all 35 in byte order, the reviewer reads 33 in display order, and the two orders are not the same.
2 HOW IT WAS WEAVED · AI + HUMAN
This is Trojan Source, Boucher and Anderson (2021, CVE-2021-42574); the bidirectional algorithm itself is UAX #9 and is required to display Arabic and Hebrew correctly.
AVAN (AI) checked the format category rather than trusting the word ‘invisible’, and reports the visible-versus-total count because that gap is the vulnerability: 35 against 33. Nothing here is malformed, no parser is confused, and no standard is violated — the compiler and the reviewer are both reading correctly. They are reading two different orderings of the same bytes, and only one of them compiles.
AVAN (AI) checked the format category rather than trusting the word ‘invisible’, and reports the visible-versus-total count because that gap is the vulnerability: 35 against 33. Nothing here is malformed, no parser is confused, and no standard is violated — the compiler and the reviewer are both reading correctly. They are reading two different orderings of the same bytes, and only one of them compiles.
3 ONE DIMENSION
Nine characters. Two readers. Two orders.
4 TWO DIMENSIONS · INTERACTIVE
Add a control and watch the line rearrange itself.
5 THREE DIMENSIONS + AVAN’S INVERSE
The green forward object.
AVAN’s addition (the inverse-companion): the forward reading is that compilers should reject unbalanced bidi controls in source. The inverse is that code review has always assumed the reviewer and the compiler read the same artifact, and they never did — one reads rendered text, the other reads bytes. Read backwards, this is not a Unicode flaw but the first time that gap was made large enough to walk through, and every review process that signs off on an appearance is trusting a rendering pipeline nobody audits.
LIT there are 9 bidirectional control characters, U+202A to U+202E and U+2066 to U+2069, and all 9 belong to Unicode's format category, all 9 are a single code unit and all 9 draw nothing; a source line carrying 2 of them measures 35 code points of which 33 are visible, so the compiler reads all 35 in byte order while the reviewer reads 33 in display order, and the two orders are not the same
FIG This is Trojan Source, Boucher and Anderson (2021, CVE-2021-42574); the bidirectional algorithm itself is UAX #9 and is required to display Arabic and Hebrew correctly. AVAN checked the format category rather than trusting the word 'invisible', and reports the visible-versus-total count because that gap IS the vulnerability: 35 against 33. Nothing is malformed, no parser is confused and no standard is violated - the compiler and the reviewer are both reading correctly, two different orderings of the same bytes.
FIG This is Trojan Source, Boucher and Anderson (2021, CVE-2021-42574); the bidirectional algorithm itself is UAX #9 and is required to display Arabic and Hebrew correctly. AVAN checked the format category rather than trusting the word 'invisible', and reports the visible-versus-total count because that gap IS the vulnerability: 35 against 33. Nothing is malformed, no parser is confused and no standard is violated - the compiler and the reviewer are both reading correctly, two different orderings of the same bytes.
◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE GATEKEEPER · David Lee Wise (ROOT0), with AVAN