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

Is validating arbitrary json with arbitrary jsonschema secure? #82

Open
F483 opened this issue Jan 15, 2016 · 0 comments
Open

Is validating arbitrary json with arbitrary jsonschema secure? #82

F483 opened this issue Jan 15, 2016 · 0 comments

Comments

@F483
Copy link
Contributor

F483 commented Jan 15, 2016

It would be an elegant interface for the pubsub system to have events be json and subscriptions be jsonschema so that the event matching is easy to implement in any language.

from jsonschema import validate
from jsonschema.exceptions import ValidationError
try:
    validate(untrusted_event, untrusted_subscribe_schema)
    event_matches_schema = True
except ValidationError:
    event_matches_schema = False

The question is, is it safe to validate untrusted events with untrusted schemas?

Immediately to mind come issues like regex backtracking vounerabilities since jsonschema supports checking strings against regex, so that would have to be disabled.

Are there other attack vectors and does a security analysis of this approach exist?

Note that events are limited to 512bytes (including subscription events).

@F483 F483 changed the title Is validating arbitrary json with arbitrary jsonschema secrure? Is validating arbitrary json with arbitrary jsonschema secure? Jan 15, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant