Live data from Hacker News

Show HN: Big List of Naughty Strings for testing user-input data

github.com

31–40 of 80 posts

Re: Show HN: Big List of Naughty Strings for testing user-input data

#31
post #29

The list seems to be missing the simplest naughty string of all: The empty string! (Well, the text file has empty lines separating the comments and example strings so it technically includes the empty string, but it's not in the JSON file.)

There is a pull request pending that fixes this.

Re: Show HN: Big List of Naughty Strings for testing user-input data

#33
post #12

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 f…

Bi-directional text is probably another one. All the bidi control characters, especially. Probably really all Unicode control characters in general.

Sure, but there's already a lot of bidi text in the file.

Re: Show HN: Big List of Naughty Strings for testing user-input data

#34

Nice; sort of a programming complement to Shutterstock's _List of Dirty, Naughty, Obscene, and Otherwise Bad Words_[0]. So helpful to have a bunch of minds working on useful lists like this. Good to see that GitHub passes this test! [0] https://github.com/shutterstock/List-of-Dirty-Naughty-Obscen...

I worked on a swear filter at a previous job. Not quite sure how this list could benefit anyone really unless you are matching a whole string e.g. title of a photo rather than words in the title of a photo.

There are so many creative ways to get around swearing. Replace letters with numbers, drop consonants and vowels. And you almost always need to check for word boundaries otherwise somebody from Scunthorpe might be upset you banned them. And then there are cases where word boundaries aren't enough. Good luck ;-)

Re: Show HN: Big List of Naughty Strings for testing user-input data

#35
post #6

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.

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. :)

Re: Show HN: Big List of Naughty Strings for testing user-input data

#36
post #12

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 f…

The range U+FDD0..U+FDEF is reserved for internal use by applications.

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!

Re: Show HN: Big List of Naughty Strings for testing user-input data

#37
I don't recall exactly where this was, but I know I've worked with an API before that sometimes dropped requests, and it was because some randomly generated data included 'naughty text' like 'xxx', or profanity. I was expecting a dataset intended to catch this problem...

Re: Show HN: Big List of Naughty Strings for testing user-input data

#38
post #13
post #11

If you really intend this for use in testing, I'd suggest making the injections less nasty. I could easily see a junior dev slapping this in and deleting some important stuff. I'd also add more invalid UTF encodings and embedded null bytes, etc. The JSON format would be preferable to plain text for that though.

Thankfully, there are no strings invoking Cthulhu :)

lol! You must be referring to the ICFP contest 2015. http://icfpcontest.org/

Re: Show HN: Big List of Naughty Strings for testing user-input data

#39
post #5

If I put this into my company's tests, we'd end up with no users... I have a lot of work ahead of me. :/

Yeah, the other exploit strings do innocuous stuff like putting up javascript alerts or touching files, but the SQL injection ones aren't innocuous at all. I wonder if there's something better to replace those with. Something like `1'; CREATE TABLE blns ...--` would be more akin to what the shell exploits do.

Re: Show HN: Big List of Naughty Strings for testing user-input data

#40

Nice "in the beginning..." hebrew string: בְּרֵאשִׁית, בָּרָא אֱלֹהִים, אֵת הַשָּׁמַיִם, וְאֵת הָאָרֶץ

Full context, this is the beggining of the bible.

Yes, I'm lazy. :p
Post reply on HN