You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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).
The text was updated successfully, but these errors were encountered:
F483
changed the title
Is validating arbitrary json with arbitrary jsonschema secrure?
Is validating arbitrary json with arbitrary jsonschema secure?
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.
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).
The text was updated successfully, but these errors were encountered: