Skip to content

Commit bb9422c

Browse files
Fix/tests (#2526)
* Add test reproducing the issue - test mocks https://some.com/image.png returning 302 Location: http://169.254.169.254/latest/meta-data, then expects load_image_from_url() to reject it before fetching the redirected URL. current code follows the redirect and decodes the mocked image bytes (resulting in test failure) * tests * test * fix * Secure URL image redirects against SSRF * test * revert * Harden image URL loading against SSRF Disable automatic redirects for URL image fetches, reject hosts that resolve to non-public addresses by default, and add an opt-in env flag for deployments that intentionally load images from private networks. Add unit coverage for redirect blocking, metadata-address DNS resolution, and the private-network override. * fix unrelated test * remove stale test * keep only tests * remove
1 parent d1dd1c3 commit bb9422c

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

tests/inference/unit_tests/core/interfaces/stream/test_workflow_model_handler.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,15 @@ def test_workflow_runner_preserves_zero_source_id_as_video_identifier():
3232
),
3333
]
3434

35-
WorkflowRunner().run_workflow(
36-
video_frames=frames,
35+
runner = WorkflowRunner(
3736
workflows_parameters={},
3837
execution_engine=engine,
3938
image_input_name="image",
4039
video_metadata_input_name="video_metadata",
4140
)
4241

42+
runner(frames)
43+
4344
assert [
4445
metadata.video_identifier
4546
for metadata in engine.runtime_parameters["video_metadata"]

0 commit comments

Comments
 (0)