forked from DefectDojo/django-DefectDojo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Importer Close Old Findings: Accommodate different dedupe algorithms
- Loading branch information
Showing
7 changed files
with
676 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
193 changes: 193 additions & 0 deletions
193
unittests/scans/semgrep/close_old_findings_report_Line31.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,193 @@ | ||
{ | ||
"version": "1.97.0", | ||
"results": [ | ||
{ | ||
"check_id": "python.lang.security.audit.dangerous-subprocess-use-tainted-env-args.dangerous-subprocess-use-tainted-env-args", | ||
"path": "sample/brute.py", | ||
"start": { | ||
"line": 31, | ||
"col": 29, | ||
"offset": 285 | ||
}, | ||
"end": { | ||
"line": 31, | ||
"col": 58, | ||
"offset": 314 | ||
}, | ||
"extra": { | ||
"metavars": { | ||
"$FUNC": { | ||
"start": { | ||
"line": 31, | ||
"col": 25, | ||
"offset": 281 | ||
}, | ||
"end": { | ||
"line": 31, | ||
"col": 28, | ||
"offset": 284 | ||
}, | ||
"abstract_content": "run" | ||
}, | ||
"$CMD": { | ||
"start": { | ||
"line": 31, | ||
"col": 29, | ||
"offset": 285 | ||
}, | ||
"end": { | ||
"line": 31, | ||
"col": 58, | ||
"offset": 314 | ||
}, | ||
"abstract_content": "[program username password]" | ||
} | ||
}, | ||
"message": "Detected subprocess function 'run' with user controlled data. A malicious actor could leverage this to perform command injection. You may consider using 'shlex.quote()'.", | ||
"metadata": { | ||
"owasp": [ | ||
"A01:2017 - Injection", | ||
"A03:2021 - Injection" | ||
], | ||
"cwe": [ | ||
"CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')" | ||
], | ||
"asvs": { | ||
"control_id": "5.3.8 OS Command Injection", | ||
"control_url": "https://github.com/OWASP/ASVS/blob/master/4.0/en/0x13-V5-Validation-Sanitization-Encoding.md#v53-output-encoding-and-injection-prevention-requirements", | ||
"section": "V5: Validation, Sanitization and Encoding Verification Requirements", | ||
"version": "4" | ||
}, | ||
"references": [ | ||
"https://stackoverflow.com/questions/3172470/actual-meaning-of-shell-true-in-subprocess", | ||
"https://docs.python.org/3/library/subprocess.html", | ||
"https://docs.python.org/3/library/shlex.html", | ||
"https://semgrep.dev/docs/cheat-sheets/python-command-injection/" | ||
], | ||
"category": "security", | ||
"technology": [ | ||
"python" | ||
], | ||
"confidence": "MEDIUM", | ||
"cwe2022-top25": true, | ||
"cwe2021-top25": true, | ||
"subcategory": [ | ||
"vuln" | ||
], | ||
"likelihood": "MEDIUM", | ||
"impact": "MEDIUM", | ||
"license": "Commons Clause License Condition v1.0[LGPL-2.1-only]", | ||
"vulnerability_class": [ | ||
"Command Injection" | ||
], | ||
"source": "https://semgrep.dev/r/python.lang.security.audit.dangerous-subprocess-use-tainted-env-args.dangerous-subprocess-use-tainted-env-args", | ||
"shortlink": "https://sg.run/pLGg", | ||
"semgrep.dev": { | ||
"rule": { | ||
"origin": "community", | ||
"r_id": 27262, | ||
"rule_id": "AbUgrZ", | ||
"rv_id": 928299, | ||
"url": "https://semgrep.dev/playground/r/0bTpAQn/python.lang.security.audit.dangerous-subprocess-use-tainted-env-args.dangerous-subprocess-use-tainted-env-args", | ||
"version_id": "0bTpAQn" | ||
} | ||
} | ||
}, | ||
"severity": "ERROR", | ||
"fingerprint": "1d0cfd65fc17a97773e848ec31ddd8a580c5fb54914f03bebe4f934a16d5d45f22cfd3ab1b9f3ab9871da06569701e38ea2b518d2a1aa397cd5d7ecbd699d4a4_0", | ||
"lines": " result = subprocess.run([program, username, password], stdout=subprocess.DEVNULL)", | ||
"is_ignored": false, | ||
"dataflow_trace": { | ||
"taint_source": [ | ||
"CliLoc", | ||
[ | ||
{ | ||
"path": "sample/brute.py", | ||
"start": { | ||
"line": 6, | ||
"col": 11, | ||
"offset": 64 | ||
}, | ||
"end": { | ||
"line": 6, | ||
"col": 19, | ||
"offset": 72 | ||
} | ||
}, | ||
"sys.argv" | ||
] | ||
], | ||
"intermediate_vars": [ | ||
{ | ||
"location": { | ||
"path": "sample/brute.py", | ||
"start": { | ||
"line": 6, | ||
"col": 1, | ||
"offset": 54 | ||
}, | ||
"end": { | ||
"line": 6, | ||
"col": 8, | ||
"offset": 61 | ||
} | ||
}, | ||
"content": "program" | ||
}, | ||
{ | ||
"location": { | ||
"path": "sample/brute.py", | ||
"start": { | ||
"line": 6, | ||
"col": 1, | ||
"offset": 54 | ||
}, | ||
"end": { | ||
"line": 6, | ||
"col": 8, | ||
"offset": 61 | ||
} | ||
}, | ||
"content": "program" | ||
} | ||
], | ||
"taint_sink": [ | ||
"CliLoc", | ||
[ | ||
{ | ||
"path": "sample/brute.py", | ||
"start": { | ||
"line": 31, | ||
"col": 29, | ||
"offset": 285 | ||
}, | ||
"end": { | ||
"line": 31, | ||
"col": 58, | ||
"offset": 314 | ||
} | ||
}, | ||
"[program, username, password]" | ||
] | ||
] | ||
}, | ||
"engine_kind": "OSS", | ||
"validation_state": "NO_VALIDATOR" | ||
} | ||
} | ||
], | ||
"errors": [], | ||
"paths": { | ||
"scanned": [ | ||
"README.md", | ||
"sample/brute.py", | ||
"sample/findmysecrets.go", | ||
"sample/function.go", | ||
"sample/go.mod", | ||
"sample/session.go", | ||
"sample/sqli.go" | ||
] | ||
}, | ||
"interfile_languages_used": [], | ||
"skipped_rules": [] | ||
} |
Oops, something went wrong.