-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Secure allocator #412
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Secure allocator #412
Conversation
Retracting |
(Retracted? But the branch is deleted and re-created? I'll re-open this for now.) Here are my initial comments:
So let's talk about that. Would it be reasonable to expect people to compile with a special option if they want securely-wiped strings? |
After thinking about this more, I have another question: What about user interactions? The API includes
I actually worked in security at Amazon, including internal customer data security and GovCould applications, and even more secret stuff. I remember the long trail of blunders inserted into openssl by security "experts". There is no such thing as a security expert. Everybody makes mistakes. The answer is simplicity. I suggest that you consider a different, simpler JSON library, gason. It's a much smaller code-base, and it has complete control over memory. Strings are simply For a C++ security application at Amazon (and of course I cannot give you details), we took memory pages from a pre-allocated pool for each request. All memory for that request came from those pages, and we wiped those pages at the end of each request, before returning them to the memory pool. Very simple to analyze. In my opinion The good news is that we really don't change JsonCpp much. Your fork is not likely to diverge far. If we make a significant change, we would probably use a new branch with a major version bump. I don't want to discourage you from using your code if it satisfies your particular requirements well. |
Hi Chris, thanks so much for this, we're in the middle of re-working this because as you say the diff was just too massive when it got reviewed internally which is why we opted to remove it. Thanks so much for the comments above, we'll try as hard as possible to go in that direction; with regards to std::string in the API, for backward compatibility it's no issue hopefully because people will be using std::string with the standard allocator. What we're trying to do is use Value<String, Allocator> as the type and then have everywhere else SomeClass; what this means is that we're using typedef's from Value to dictate the usage of string everywhere else. At the moment we've left some as std::string still and not Value::String because we wondered whether for errors you'd like to have them a string still but were concerned that they could then contain errors with sensitive information. On the numbers, yeah, I'd just wondered who would have secure numbers in JSON, there just isn't space in a number for it to be particularly sensitive but i guess you could have an array of numbers for example representing a password or key or ... so will have a good think about that too. I will need to have a careful think about the union and how it will be affected by using allocators. We will hopefully get this finished by the end of the weekend to as you say work through the commits in a more structured approach. Thanks a lot, christopher |
No description provided.