Skip to content
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

Security tests over "fuzzed" inputs? #4

Closed
castarco opened this issue Jul 29, 2016 · 2 comments
Closed

Security tests over "fuzzed" inputs? #4

castarco opened this issue Jul 29, 2016 · 2 comments

Comments

@castarco
Copy link

It's very important to make security tests over "fuzzed" inputs. What happens if the serialized input is corrupted?

I think it's probable that a big proportion of the performance gains over other serialization libraries is related to lack of security checks.

@castarco castarco changed the title Security tests? Security tests over "fuzzed" inputs? Jul 29, 2016
@phretaddin
Copy link
Owner

phretaddin commented Jul 29, 2016

As of right now the program just tries to decode it with the given schema and if it doesn't "fit", it'll most likely just crash because it will try to read past the buffer. This was by design because I wanted my program to crash if I was sending invalid messages that didn't match the schema I wanted to find out instantly so I could fix it.

However, if the buffer is longer than what the schema expects or the user supplies matching byte count types (like uint instead of int), the resulting object could have invalid data in it. I was toying with the idea of having a "validation" flag that you could optionally set to compile in checks to validate/test everything to isolate all these kinds of potential issues, but haven't quite figured out how I'd like to do it or if there was going to be any demand for that feature/this library. Let me know if you have any ideas/preferences!

@phretaddin
Copy link
Owner

Added support for validation of encoded objects.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants