Describe the bug
When evaluation tornado the line to get the vuln_specifiers fails because the version value is "-". This raises an InvalidSpecifier error from the packaging module.
To Reproduce
Running orchrona tornado on version 2.0.2
Expected behavior
An error not to be raised and ochrona to detect potential vulnerabilities.
Background (please complete the following information):
- OS: WSL2 Ubuntu 22.04
- Python Version: 3.10.6
- Ochrona Version: 2.0.2
- Ochrona Arguments: tornado
- Debug output:
ochrona tornado --debug
,---. |
| |,---.|---.,---.,---.,---.,---.
| || | || | || |,---|
`---'`---'` '` `---'` '`---^
v. 2.0.2
https://ochrona.dev
Processing 0 Files... ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 0% -:--:--
(DEBUG) Discovered dependencies:
--- tornado
(DEBUG) DB instance found: 2022.07.14
(DEBUG) Found 4 vulnerabilities potentially affecting package: tornado
Traceback (most recent call last):
File "/home/arichardson/experiments/ochrona-cli/ochrona/eval/vuln/evaluate.py", line 64, in evaluate
vuln_specifiers &= f"=={versions['version_value']}"
File "/home/arichardson/experiments/ochrona-cli/.venv/lib/python3.10/site-packages/packaging/specifiers.py", line 778, in __and__
other = SpecifierSet(other)
File "/home/arichardson/experiments/ochrona-cli/.venv/lib/python3.10/site-packages/packaging/specifiers.py", line 700, in __init__
parsed.add(Specifier(specifier))
File "/home/arichardson/experiments/ochrona-cli/.venv/lib/python3.10/site-packages/packaging/specifiers.py", line 234, in __init__
raise InvalidSpecifier(f"Invalid specifier: '{spec}'")
packaging.specifiers.InvalidSpecifier: Invalid specifier: '==-'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/arichardson/experiments/ochrona-cli/.venv/bin/ochrona", line 33, in <module>
sys.exit(load_entry_point('ochrona', 'console_scripts', 'ochrona')())
File "/home/arichardson/experiments/ochrona-cli/.venv/lib/python3.10/site-packages/click/core.py", line 1130, in __call__
return self.main(*args, **kwargs)
File "/home/arichardson/experiments/ochrona-cli/.venv/lib/python3.10/site-packages/click/core.py", line 1055, in main
rv = self.invoke(ctx)
File "/home/arichardson/experiments/ochrona-cli/.venv/lib/python3.10/site-packages/click/core.py", line 1404, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/home/arichardson/experiments/ochrona-cli/.venv/lib/python3.10/site-packages/click/core.py", line 760, in invoke
return __callback(*args, **kwargs)
File "/home/arichardson/experiments/ochrona-cli/ochrona/cli/cli.py", line 177, in run
results.append(resolve(**payload))
File "/home/arichardson/experiments/ochrona-cli/ochrona/eval/eval.py", line 30, in resolve
resp.confirmed_vulnerabilities = evaluate(vulns, resp.flat_list)
File "/home/arichardson/experiments/ochrona-cli/ochrona/eval/vuln/evaluate.py", line 104, in evaluate
raise Exception("evaluate exception") from ex
Exception: evaluate exception
Describe the bug
When evaluation tornado the line to get the
vuln_specifiersfails because the version value is "-". This raises anInvalidSpecifiererror from the packaging module.To Reproduce
Running
orchrona tornadoon version2.0.2Expected behavior
An error not to be raised and ochrona to detect potential vulnerabilities.
Background (please complete the following information):