Cheuk Ting Ho
Developer advocate / Data Scientist - support open-source and building the community.
Can we trust open-source anymore?
Cheuk Ting Ho
(In Python perspective)
hello = "Hello world"
world = hello
print(world)
hello = "Hello world"
world = hello
print(world)
import pandas as 🐼🐼
Some languages are not written from left to right
So Unicode has to address this
Characters to format the direction of the flow of text
Code could be interpreted or compiled differently than what appears to be
If we use them in code...
Thus... create Trojan Source Malware
What it looks like
What it actually is
What it looks like
What it actually is
What it looks like
What it actually is
Durm rolls...
As shown before
Does not work on Python 3.9.5 (on MacOS via clang 12.0.0): Throws Syntax Error
Ban the use of text directionality control characters?
Use a text editor with good syntax highlighting?
Scan the invisible characters and directionality control characters?
Look before running the code!!!
Good linter - e.g. Pylint
Dive deeper at https://trojansource.codes/
By Cheuk Ting Ho
Developer advocate / Data Scientist - support open-source and building the community.