You've already forked adk-python
mirror of
https://github.com/encounter/adk-python.git
synced 2026-03-30 10:57:20 -07:00
fix: fix SSRF vulnerability in load_web_page by disabling automatic redirects
Co-authored-by: Sasha Sobran <asobran@google.com> PiperOrigin-RevId: 853901476
This commit is contained in:
committed by
Copybara-Service
parent
f1ccc0cfca
commit
3c51ee7f48
@@ -28,7 +28,8 @@ def load_web_page(url: str) -> str:
|
||||
"""
|
||||
from bs4 import BeautifulSoup
|
||||
|
||||
response = requests.get(url)
|
||||
# Set allow_redirects=False to prevent SSRF attacks via redirection.
|
||||
response = requests.get(url, allow_redirects=False)
|
||||
|
||||
if response.status_code == 200:
|
||||
soup = BeautifulSoup(response.content, 'lxml')
|
||||
|
||||
Reference in New Issue
Block a user