JSON cannot represent some naughty strings
See original GitHub issueOne of my favourite naughty strings is invalid utf-8 - for example, a bare \xff
.
It’s quite common to get 500s,etc on these as no-one ever bothers to check for unicode decoding errors.
However, because JSON requires all strings to be valid utf-8, this example is only able to be included in the txt file.
Would this be something worth including and adding a special case in the script to omit from the json? Or is it too naughty for blns?
EDIT: This HN comment (https://news.ycombinator.com/item?id=10035738) suggested having the JSON file be of b64 encoded strings. This is a good suggestion, and allows arbitrary naughty bytes to be used, at the cost of readability.
Issue Analytics
- State:
- Created 8 years ago
- Comments:8 (1 by maintainers)
Top Results From Across the Web
minimaxir/big-list-of-naughty-strings - GitHub
The Big List of Naughty Strings is a list of strings which have a high probability of causing issues when used as user-input...
Read more >Developers - JSON cannot represent some naughty strings -
JSON cannot represent some naughty strings ... One of my favourite naughty strings is invalid utf-8 - for example, a bare \xff ....
Read more >Big List of Naughty Strings - Morioh
The Big List of Naughty Strings is a list of strings which have a high probability of causing issues when used as user-input...
Read more >Big list of naughty strings. : r/programming - Reddit
tar files, just like any other data in a computer, is just a number; wether you represent is as binary/decimal/octal/hex/base-X is not relevant....
Read more >How to fix "Incorrect string value" errors? - Stack Overflow
You can change the encoding to utf8mb4 for either a database or a table with only a few lines of SQL to fix...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Just so that’s clear, JSON does not require UTF-8 any longer, but valid unicode. The UTF-8 requirement is from an older version of JSON.
Doesn’t change much about this topic, but it’s worth noting.
Given that some software environments conflate bytes and strings, or naively assume ASCII (or well-formed UTF-8, or whatever), I think it makes perfect sense to include byte sequences in here that cause decoding issues.
I don’t think that specifying an encoding is necessary, but having a comment explaining what the point of the byte sequence is would be useful—and that could mention the specific encoding that is being targeted.