mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2026-04-05 22:55:22 +00:00
Security: Fix SSRF in superbooga extensions
This commit is contained in:
parent
80e81a54ca
commit
f6f8f14c8d
2 changed files with 5 additions and 0 deletions
|
|
@ -2,8 +2,11 @@ import concurrent.futures
|
|||
|
||||
import requests
|
||||
|
||||
from modules.web_search import _validate_url
|
||||
|
||||
|
||||
def download_single(url):
|
||||
_validate_url(url)
|
||||
headers = {
|
||||
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.3'
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,12 +5,14 @@ import requests
|
|||
from bs4 import BeautifulSoup
|
||||
|
||||
import extensions.superboogav2.parameters as parameters
|
||||
from modules.web_search import _validate_url
|
||||
|
||||
from .data_processor import process_and_add_to_collector
|
||||
from .utils import create_metadata_source
|
||||
|
||||
|
||||
def _download_single(url):
|
||||
_validate_url(url)
|
||||
response = requests.get(url, timeout=5)
|
||||
if response.status_code == 200:
|
||||
return response.content
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue