Live data from Hacker News

Can we believe our eyes? Misleading people with Unicode.

blogs.technet.com

51–60 of 128 posts

Re: Can we believe our eyes? Misleading people with Unicode.

#51
It's funny to think that a hapless vimmer who happens to be running Windows would have never noticed this, because they would simply have typed ":edit $SYSTEMROOT\system32\drivers\etc\hosts" and gotten the real file.

(This isn't a "look how cool command line junkies are" comment; I was just musing.)

Re: Can we believe our eyes? Misleading people with Unicode.

#52
post #43

On Linux, how could you make standard tools highlight or differentiate potentially misleading characters? I guess the solution would have to be in the terminal emulator? Would a blacklist of Unicode ranges be sufficient?

od -h -- I used to run into this problem a lot when I was writing grammars against different locales

I'm aware of od, xxd, etc.

I'm wondering if there's a way to make it more obvious that doesn't require running od. It should be immediately apparent any time there's a file with a whacky name, not something you find out two minutes into investigating a compromise.

Re: Can we believe our eyes? Misleading people with Unicode.

#56
This is an important issue in some chat programs. I had to deal with this all the time: malicious users using i vs. l to pose as others, and using unicode to mess up or reverse the entire chat. One of the more interesting unicode had characters going left, right, and up and down. This confused moderators about who to kick/ban and obscured other users' text.

The solution was to implement a regex of whitelisted characters; since it's an English-only program, this works well and is future-safe. For multiple languages, a blacklist is probably okay, but the difficulty lies in keeping the blacklist both complete and up to date.

Re: Can we believe our eyes? Misleading people with Unicode.

#57
post #29

Earlier quoted context omitted.

Since Windows by default don't show hidden files, I must say that most of my engineer coleagues would fall in the trick. Sadly, most people that I worked open the files manually.

How is the real hosts file rendered hidden in Explorer?

Like any other hidden file, it's not rendered until you choose to show hidden files and then at the point, it shows the file, but the icon is semi transparent.

Re: Can we believe our eyes? Misleading people with Unicode.

#58
post #35
post #26

Earlier quoted context omitted.

Are you sure? curling from Terminal, I get the same result.

That's probably because your terminal interprets the RLO character. Should it? I'm not sure.

rxvt-unicode, despite being perfectly able to display unicode characters (hence the name), drops the RLO.

Re: Can we believe our eyes? Misleading people with Unicode.

#60
post #21

Earlier quoted context omitted.

That's a clever idea, but I don't know how one would determine what "unexpected" is an increasingly international world.

Code point has script property and mixing it inside strings which aren't likely to contain multiscript code points (like filenames) is a sign of trouble.

Filenames can contain multiscript code points.

E.g.: "Архив.gz" (Archive.gz)

Post reply on HN