Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.
fix(python): address URL fetch security vulnerabilities
- Add ResponseTooLargeError exception for size limit violations - Implement streaming downloads with 100MB size limit - Disable automatic redirect following for security - Fix S3 upload treating HTTP 403 as success - Add URL sanitization for safe logging (redact query params) - Add comprehensive security tests for new functionality - Document MD5 usage (for integrity, not cryptographic security) Addresses security review findings from PR #2462. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
jkomyno committed
Feb 2, 2026 at 20:24 UTC
57e802a2a201b85b3b9f71c657552368fb070d54
1 file changed
+3
-1
python/tests/test_files.py
+3
-1
@@ -1647,8 +1647,10 @@ class TestFetchFileFromUrlWithTruncation:
1647
"""Long real-world URLs should be handled correctly."""
1648
mock_response = MagicMock()
1649
mock_response.ok = True
1650
- mock_response.content = b"test content"
1650
+ mock_response.status_code = 200
1651
mock_response.headers = {"content-type": "application/pdf"}
1652
+ mock_response.iter_content.return_value = [b"test content"]
1653
+ mock_response.close = MagicMock()
1654
mock_get.return_value = mock_response
1655
1656
# Real-world long URL example (no extension, relies on mimetype)