Skip to content

Security: HTTP requests are performed without timeout safeguards#1683

Open
tomaioo wants to merge 3 commits intointel:mainfrom
tomaioo:fix/security/http-requests-are-performed-without-time
Open

Security: HTTP requests are performed without timeout safeguards#1683
tomaioo wants to merge 3 commits intointel:mainfrom
tomaioo:fix/security/http-requests-are-performed-without-time

Conversation

@tomaioo
Copy link
Copy Markdown

@tomaioo tomaioo commented Apr 15, 2026

Summary

Security: HTTP requests are performed without timeout safeguards

Problem

Severity: Low | File: auto_round/compressors/mllm/utils.py:L48

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.

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)

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
Copy link
Copy Markdown

Azure Pipelines:
Successfully started running 6 pipeline(s).
1 pipeline(s) require an authorized user to comment /azp run to run.

Comment thread auto_round/compressors/mllm/utils.py Outdated
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:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Copy Markdown

Azure Pipelines:
Successfully started running 6 pipeline(s).
1 pipeline(s) require an authorized user to comment /azp run to run.

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines:
Successfully started running 6 pipeline(s).
1 pipeline(s) require an authorized user to comment /azp run to run.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants