Security: HTTP requests are performed without timeout safeguards#1683
Open
tomaioo wants to merge 3 commits intointel:mainfrom
Open
Security: HTTP requests are performed without timeout safeguards#1683tomaioo wants to merge 3 commits intointel:mainfrom
tomaioo wants to merge 3 commits intointel:mainfrom
Conversation
Remote downloads are executed via `requests.get` without a timeout in multiple places. This can cause hangs or worker exhaustion when endpoints are slow/unresponsive, leading to denial-of-service conditions in long-running services. Signed-off-by: tomaioo <203048277+tomaioo@users.noreply.github.com>
|
Azure Pipelines: Successfully started running 6 pipeline(s). 1 pipeline(s) require an authorized user to comment /azp run to run. |
hshen14
reviewed
Apr 15, 2026
| response = requests.get(path_or_url, stream=True, timeout=(3, 10)) | ||
| response.raise_for_status() | ||
| image_obj = Image.open(response.raw) | ||
| except requests.exceptions.RequestException as e: |
Contributor
There was a problem hiding this comment.
Suggest changing to below in case the exception may happen from PIL not requests:
except (requests.exceptions.RequestException, OSError) as e:
raise RuntimeError(f"Failed to fetch image from url: {path_or_url}") from e
…exception may happen f Signed-off-by: tomaioo <203048277+tomaioo@users.noreply.github.com>
|
Azure Pipelines: Successfully started running 6 pipeline(s). 1 pipeline(s) require an authorized user to comment /azp run to run. |
for more information, see https://pre-commit.ci
|
Azure Pipelines: Successfully started running 6 pipeline(s). 1 pipeline(s) require an authorized user to comment /azp run to run. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Security: HTTP requests are performed without timeout safeguards
Problem
Severity:
Low| File:auto_round/compressors/mllm/utils.py:L48Remote downloads are executed via
requests.getwithout a timeout in multiple places. This can cause hangs or worker exhaustion when endpoints are slow/unresponsive, leading to denial-of-service conditions in long-running services.Solution
Use explicit connect/read timeouts (e.g.,
timeout=(3, 10)) and handle exceptions (requests.exceptions.RequestException) to fail safely.Changes
auto_round/compressors/mllm/utils.py(modified)