Lurker News

Comments (79) 27 threads

rspeer5 replies#
Most of what I do involves the messy world of text, and I think this is a great resource. I wish the software I depended on tested against it.

I can think of a few more cases that I've seen cause havoc:
- U+FEFF in the middle of a string (people are used to seeing it at the beginning of a string, because Microsoft, but elsewhere it may be more surprising)
- U+0 (it's encoded as the null byte!)
- U+1B (the codepoint for "escape")
- U+85 (Python's "codecs" module thinks this is a newline, while the "io" module and the Python 3 standard library don't)
- U+2028 and U+2029 (even weirder linebreaks that cause disagreement when used in JSON literals)
- A glyph with a million combining marks on it, but not in NFC order (do your Unicode algorithms use insertion sort?)
- The sequence U+100000 U+010000 (triggers a weird bug in Python 3.2 only)
- "Forbidden" strings that are still encodable, such as U+FFFF, U+1FFFF, and for some reason U+FDD0
People should also test what happens with isolated surrogate codepoints, such as U+D800. But these can't properly be encoded in UTF-8, so I guess don't put them in the BLNS. (If you put the fake UTF-8 for them in a file, the best thing for a program to do would be to give up on reading the file.)

gsnedders1 reply#
Bi-directional text is probably another one. All the bidi control characters, especially. Probably really all Unicode control characters in general.
rspeer1 reply#
Sure, but there's already a lot of bidi text in the file.
gsnedders1 reply#
Bah, I only saw mono-directional text. Looking closely I only see one line of with bi-directional text, "הָיְתָהtestالصفحات التّحول"?

Continue this thread — 1 reply

grapeshot#
Isolated UTF-16 surrogate code points definitely crash Unity when it tries to display them. (Seen when I pasted some emoji in a text box in TIS-100 and tried to backspace.)
pwenzel#
This. Hidden white space has ruined my day before!
gizmo6861 reply#
The range U+FDD0..U+FDEF is reserved for internal use by applications.
duskwuff#
It's supposed to be reserved for applications. In practice... you may see them in the wild anyway. So it's important that they show up in test vectors!
zuzun#
BOMs have already caught me off guard at the start of strings.
jsat4 replies#
" # Server Code Injection # # Strings which can cause user to run code on server as a privileged user (c.f. https://news.ycombinator.com/item?id=7665153)

/dev/null; rm -rf /*; echo " That's a little aggressive for testing no?

jleader3 replies#
Some would argue that if you're testing on a system you can't recreate easily/quickly, you're doing devops wrong.
pavel_lishin1 reply#
And I'd agree, but this would be a pretty disproportionate punishment for the crime of doing devops wrong :P
DonHopkins#
It's two crimes: doing devops wrong, and having a huge security hole.
xtreme#
The problem is not restoring the system, but the time lost in figuring out what caused it without any logs.
rattray#
A lot of people do devops wrong... and I don't want to make those people even more scared to test things.
minimaxir#
Accepted a pull request which is nicer.
cowls1 reply#
Likewise:

1;DROP TABLE users 1'; DROP TABLE users--
Seems a bit hairy to have that in there in case someone tries to run these tests on their prod environment

ckv4281 reply#
Why would you test in a prod environment?
cowls#
Well the sample was testing against twitter (obviously prod).

So someone may test against prod if they didn't really know what these things could do.

MertsA#
it also won't work as most systems are going to require --no-preserve-root for that to do anything.
afandian3 replies#
One fun (and very interesting) string is EICAR[0]. I worked for an antivirus company once and we had the EICAR string for testing but couldn't check it into source control because it triggered the AV software which we dogfooded...

Is it naughty to include it here?

    X5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*

[0] https://en.wikipedia.org/wiki/EICAR_test_file
voltagex_1 reply#
Fun times indeed. Windows defender picks up a test.txt with those contents as malicious (and closes the file handle causing Notepad to misbehave) but if you add a space between EI and CAR it doesn't see anything.

Edit: Seriously, Microsoft?
Category: Virus
Description: This program is dangerous and replicates by infecting other files.
Recommended action: Remove this software immediately.
Items: file:C:\Users\Adam\Desktop\test.txt

lmm1 reply#
Microsoft is doing the right thing. The whole point of that string is to trigger such behaviour. It's so you can use it to test that your antivirus is working.
voltagex_2 replies#
Should it really tell the user that it's a dangerous file? Although if it didn't, malicious files could use that to their advantage.

Continue this thread — 2 replies

girvo1 reply#
Aw, Sophos on OS X doesn't think it's a threat.
afandian1 reply#
Without giving too much away, I was sufficiently surprised by that that I downloaded the Sophos for Mac Home Edition. It does recognise it.

Here's what I get: http://i.imgur.com/JQzVsQf.png
This was picked up by the on-access scanner and a manual scan. The Web Protection doesn't complain about the text in a page (rightly or wrongly).
Are you using a centrally managed version (i.e. not Home Edition)?

girvo1 reply#
Interestingly, I found what caused the false-negative. If I used Vim to create the file, it was picked up. If I "echo ...EICAR > text.txt" it doesn't get picked up, at least not immediately!

Continue this thread — 1 reply

efriese1 reply#
Yeah, I would make the SQL injection and command injections test a little less kinetic =). Using a simple SELECT test, like SELECT @@VERSION, would be a little safer... Edit: Forget to say thanks! This is a pretty cool list.
bryanlarsen1 reply#
You want something that modifies so that you can detect that the SQL executed. But an INSERT would be a much friendlier than a DROP TABLE. :)
efriese#
Not necessarily. If you do a test with good SQL and a second test with SQL Injection and compare the responses that can show SQL Injection exists without having to change the database. This won't work for all SQL injection tests, but I would rather take this approach first.

Load more comments