mirror of
https://github.com/norandom/OpenUltraSAST.git
synced 2026-10-18 04:29:27 +00:00
22 lines
766 B
Python
22 lines
766 B
Python
# Provenance: Contrast-Security-OSS/vulnpy do_os_system (fixed).
|
|||
|
|
# repo: Contrast-Security-OSS/vulnpy
|
||
|
|
# commit: d1d0f64c06f038fe59a049e0e6001bfaf9839697
|
||
|
|
# parent: d1d0f64c06f038fe59a049e0e6001bfaf9839697
|
||
|
|
# commit_url: https://github.com/Contrast-Security-OSS/vulnpy/blob/d1d0f64c06f038fe59a049e0e6001bfaf9839697/src/vulnpy/trigger/cmdi.py#L6
|
||
|
|
# cve:
|
||
|
|
# license: MIT
|
||
|
|
# function: do_os_system
|
||
|
|
# relpath: src/vulnpy/trigger/cmdi.py
|
||
|
|
# provenance: human
|
||
|
|
# mechanism: source_reaches_sink
|
||
|
|
|
||
|
|
def _execute(db_func):
|
||
|
|
try:
|
||
|
|
db_connection = _db_reset()
|
||
|
|
cursor = db_connection.cursor()
|
||
|
|
db_func(cursor)
|
||
|
|
all_rows = cursor.execute(SELECT_ALL)
|
||
|
|
return ";".join([",".join(row) for row in all_rows])
|
||
|
|
except Exception:
|
||
|
|
return "error"
|