Reply to post: The example given seems to be incorrect

Trojan Source attack: Code that says one thing to humans tells your compiler something very different, warn academics

Ciaran McHale

The example given seems to be incorrect

It seems to me there is an error in the example in the paper (and reproduced in the article) claiming to show how what appears to be just a Python comment is really a comment followed by a "return" statement.

I had a look at the paper, and it explains that the "RLI" Unicode character (right-to-left isolate) will "Force treating following text as right-to-left without affecting adjacent text" until this mode is cancelled by another command or (in the case of the example code) a newline character. This right-to-left display happens not at the level of words, but rather at the level of individual characters. Thus, the line:

''' Subtract funds from bank account then RLI''' ;return

should appear in a text editor as:

''' Subtract funds from bank account then nruter; '''

POST COMMENT House rules

Not a member of The Register? Create a new account here.

  • Enter your comment

  • Add an icon

Anonymous cowards cannot choose their icon