From 4a886d970e01efeaad830e17e782e2e2691201f0 Mon Sep 17 00:00:00 2001 From: Zohaib Hassnain <109234410+ZohaibHassan16@users.noreply.github.com> Date: Wed, 19 Aug 2026 17:06:01 +0500 Subject: [PATCH] fix seed SSRF (#942) Co-authored-by: Sameer Kadam Co-authored-by: Mohd Kaif <98801504+KaifAhmad1@users.noreply.github.com> --- semantica/seed/seed_manager.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/semantica/seed/seed_manager.py b/semantica/seed/seed_manager.py index 6e52c382..3e6ebbf8 100644 --- a/semantica/seed/seed_manager.py +++ b/semantica/seed/seed_manager.py @@ -38,6 +38,7 @@ from datetime import datetime from pathlib import Path from typing import Any, Dict, List, Optional, Union +from ..ingest.ssrf import request_with_ssrf_guard from ..utils.exceptions import ProcessingError, ValidationError from ..utils.helpers import read_json_file, write_json_file from ..utils.logging import get_logger @@ -456,8 +457,8 @@ class SeedDataManager: """ Load seed data from API. - Makes an HTTP GET request to an API endpoint and parses the JSON - response. Handles various response structures (list, dict with + Makes an SSRF-protected HTTP GET request to an API endpoint and parses + the JSON response. Handles various response structures (list, dict with 'entities', 'data', 'results', 'items' keys). Automatically adds entity_type, relationship_type, and source metadata if provided. @@ -493,8 +494,6 @@ class SeedDataManager: ... ) """ try: - import requests - # Build full URL if endpoint: full_url = f"{api_url.rstrip('/')}/{endpoint.lstrip('/')}"