fix: replace bare except with specific exception types - #15430
Conversation
When GitHub API calls fail, execution continued with undefined 'issue' variable, causing UnboundLocalError. Also replace bare except with specific Exception type.
|
This pull request contains critical security findings because an unauthorized author modified multiple sensitive codepaths, including
🔴 Configured Sensitive Codepath Modified by Non-Allowed Author in
|
| Vulnerability | Configured Sensitive Codepath Modified by Non-Allowed Author |
|---|---|
| Description | File 'dojo/api_v2/serializers.py' matches configured sensitive codepath pattern 'dojo/api_v2/*.py' and was modified by 'lxcxjxhx' (commit d49a6e4) who is not in the allowed authors list. |
🔴 Configured Sensitive Codepath Modified by Non-Allowed Author in dojo/endpoint/models.py (drs_1d3408a1)
| Vulnerability | Configured Sensitive Codepath Modified by Non-Allowed Author |
|---|---|
| Description | File 'dojo/endpoint/models.py' matches configured sensitive codepath pattern 'dojo/endpoint/*.py' and was modified by 'lxcxjxhx' (commit d49a6e4) who is not in the allowed authors list. |
🔴 Configured Sensitive Codepath Modified by Non-Allowed Author in dojo/utils.py (drs_d7b00d0f)
| Vulnerability | Configured Sensitive Codepath Modified by Non-Allowed Author |
|---|---|
| Description | File 'dojo/utils.py' matches configured sensitive codepath pattern 'dojo/utils.py' and was modified by 'lxcxjxhx' (commit d49a6e4) who is not in the allowed authors list. |
We've notified @mtesauro.
Comment to provide feedback on these findings.
Report false positive: @dryrunsecurity fp [FINDING ID] [FEEDBACK]
Report low-impact: @dryrunsecurity nit [FINDING ID] [FEEDBACK]
Example: @dryrunsecurity fp drs_90eda195 This code is not user-facing
All finding details can be found in the DryRun Security Dashboard.
|
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
|
Conflicts have been resolved. A maintainer will review the pull request shortly. |
Summary
Replace bare \except:\ clauses with specific exception types to improve error handling precision.
Changes
Rationale
Bare \except:\ clauses catch \SystemExit, \KeyboardInterrupt, and \GeneratorExit\ in addition to regular exceptions. This can:
Using specific exception types makes the error handling more precise and prevents these issues.