kbase / relation_engine

Repository containing the KBase Relation Engine API, specs, and other related files.
MIT License
3 stars 11 forks source link

Bandit flags `urlopen` in `json_validator.py` #156

Open MrCreosote opened 2 years ago

MrCreosote commented 2 years ago

After switching the urlopen and urlsplit imports in json_validation.py from jsonschema.compat (which was internal-only and is now removed) to urllib, bandit complains about using urlopen without rigorously checking the url schema. The only reason it didn't before is due to the indirect import in jsonschema.compat.

For now, I'm just going to mark it as # nosec but we should determine which schemas we need and alter the function to just support those.

https://github.com/kbase/relation_engine/blob/bc5c32d2e367aafe8fd33a627a8fef96a553dbfc/relation_engine_server/utils/json_validation.py#L168