Is datasets safe?
- Python filesystem read
- Python filesystem write/delete
- Python network egress
datasets-5.0.1 is an AI python_package analyzed by SkillTotal's deterministic static scanner. The scan found no malicious indicators, though 4 risky constructs are reported for review. It can: filesystem read, filesystem write and network egress — capabilities are what the code can do, not a verdict on intent. Risk score 10/100 (low).
datasets-5.0.1 5.0.1
Automated static-analysis result. It can contain false positives and false negatives, and is not a claim about the intent of datasets's authors. Report a false positive.
Behavioral traits
How this component maps to the CSA agentic threat model. Descriptive — it never affects the risk score.
Findings (4)
A server is bound to all network interfaces (0.0.0.0), not just your own machine.
path_without_archive = path.split("::", 1)[0]Why it matters: Without authentication, other hosts on the network can reach it.
Fix: Bind to 127.0.0.1 for local-only use, or require authentication and restrict access if remote exposure is intended.
The component reads files from disk.
long_description=open("README.md", encoding="utf-8").read(),with open(dataset_state_json_path, encoding="utf-8") as state_file:
with open(dataset_info_path, encoding="utf-8") as dataset_info_file:
legacy_dataset_info: dict = json.loads(fs.read_text(config.DATASETDICT_INFOS_FILENAME, encoding="utf-8")).get(
dataset_card = DatasetCard(fs.read_text(config.REPOCARD_FILENAME, newline="", encoding="utf-8"))
legacy_dataset_infos: dict = json.loads(fs.read_text(config.DATASETDICT_INFOS_FILENAME, encoding="utf-8"))
with open(names_filepath, encoding="utf-8") as f:
with self._open_with_fsspec().open() as f:
return self._open_with_fsspec().open()
with open(os.path.join(dataset_infos_dir, config.DATASETDICT_INFOS_FILENAME), encoding="utf-8") as f:
with open(standalone_yaml_path, encoding="utf-8") as f:
with open(os.path.join(self.path, config.DATASETDICT_INFOS_FILENAME), encoding="utf-8") as f:
with open(standalone_yaml_path, encoding="utf-8") as f:
with open(dataset_infos_path, encoding="utf-8") as f:
dataset_card_data = DatasetCard(hffs.read_text(readme_path, newline="", encoding="utf-8")).data
standalone_yaml_data = yaml.safe_load(hffs.read_text(standalone_yaml_path, newline="", encoding="utf-8"))
with open(file, "rb") as f:
with open(file, "rb") as f:
or json.loads(Path(cached_directory_path, "dataset_info.json").read_text(encoding="utf-8"))["config_name"]
or json.loads(Path(_cached_directory_path, "dataset_info.json").read_text(encoding="utf-8"))["config_name"]
with open(file, "rb") as f:
with open(file, encoding=self.config.encoding, errors=self.config.encoding_errors) as f:
with open(sample_file) as f:
with open(metadata_file, "rb") as f:
with open(metadata_file, "rb") as f:
Why it matters: Usually legitimate, but worth confirming it can't be steered into reading sensitive files.
Fix: Confirm which files are read and that paths cannot be influenced by untrusted input to reach sensitive locations.
The component writes or deletes files on disk.
os.remove(file_path)
os.remove(tmp_file.name)
shutil.move(tmp_file.name, cache_file_name)
os.remove(tmp_file.name)
shutil.move(tmp_file.name, indices_cache_file_name)
shutil.rmtree(dirname)
shutil.move(tmp_dir, dirname)
shutil.rmtree(tmp_dir)
os.remove(path)
shutil.move(fs._strip_protocol(src), fs._strip_protocol(dst))
shutil.rmtree(self.name)
with open(dataset_infos_path, "w", encoding="utf-8") as f:
shutil.copytree(self.cache_dir, output_dir)
path.write_bytes(data)
open(probe_file, "a")
shutil.move(file, dest)
with open(fname, "wb") as stream:
with open(output_path, "wb") as extracted_file:
shutil.copyfileobj(gzip_file, extracted_file)
with open(output_path, "wb") as extracted_file:
shutil.copyfileobj(compressed_file, extracted_file)
with open(input_path, "rb") as ifh, open(output_path, "wb") as ofh:
with open(output_path, "wb") as extracted_file:
Why it matters: Usually legitimate, but worth confirming the paths can't be controlled by untrusted input.
Fix: Confirm which files are written/deleted and that paths cannot be influenced by untrusted input.
The component makes outbound network requests.
import urllib
str(k) + "=" + urllib.parse.quote_plus(str(v)) for k, v in config_kwargs_to_add_to_suffix.items()
import httpx
import requests
from urllib.parse import urlparse
import httpx
import requests
from aiohttp.client_exceptions import ClientError as _AiohttpClientError
return urlparse(url_or_filename).scheme != "" and not os.path.ismount(urlparse(url_or_filename).scheme + ":/")
return urlparse(url_or_filename).scheme == "" or os.path.ismount(urlparse(url_or_filename).scheme + ":/")
return urlparse(url_or_filename).scheme == "" and not os.path.isabs(url_or_filename)
Why it matters: Usually legitimate, but confirm the destinations are expected and no sensitive data leaves.
Fix: Confirm the destination hosts are expected and that no sensitive data is sent off-host.
Check your own component
Run the same evidence-backed scan on any MCP server, agent skill, or package.
Scan your own componentHow we determine this: deterministic static analysis (regex + AST), evidence-anchored, no code execution. Methodology →