-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Security: No Timeout on HTTP Requests Leading to Potential Denial of Service #2103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -51,7 +51,7 @@ def is_old_pull_request(issue): | |||||||||||||
|
|
||||||||||||||
| # Grab the list of open Issues/PR | ||||||||||||||
| buffer = "Grab the list of open Issues/PR via the GitHub API...\n" | ||||||||||||||
| response = requests.get(ISSUE_API) | ||||||||||||||
| response = requests.get(ISSUE_API, timeout=30) | ||||||||||||||
|
||||||||||||||
| response = requests.get(ISSUE_API, timeout=30) | |
| try: | |
| response = requests.get(ISSUE_API, timeout=30) | |
| except requests.exceptions.RequestException as exc: | |
| print("Cannot load the list of Issues/PR content: %s" % exc) | |
| sys.exit(1) |
Copilot
AI
Apr 26, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
requests.post(..., timeout=30) can raise requests.exceptions.Timeout/RequestException and currently would terminate the script with an unhandled exception. Consider catching requests.exceptions.RequestException around the Slack webhook call and exiting with code 2 while printing a concise error (including that a timeout occurred).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR description mentions "multiple scripts" lacking request timeouts, but this change only updates
Identify_Old_Issue_And_PR.py. For example,scripts/Generate_RSS_Feed.pyandscripts/Generate_Technologies_JSON.pystill callrequests.get(...)without a timeout (as of current main). Either expand the fix set or narrow the PR description/scope accordingly.