Is pandas safe?
What pandas does
pandas is a Python library for data analysis built around labeled data structures such as Series and DataFrame. It adds tools for grouping, merging, reshaping and time series. The PyPI metadata lists The Pandas Development Team as author, and the code lives in pandas-dev/pandas under the BSD 3-Clause license. Its I/O tools read and write CSV, Excel, SQL databases, HDF5 and other formats, so it touches the files and connections your code points it at. Before installing, pin the version, and use read_pickle only on files you created or trust, since the pandas documentation warns that loading pickled data from untrusted sources can be unsafe.
- Unsafe deserialization
- Python shell/command execution
- Python dynamic code execution
What to do: Nothing here argues against installing it. Grant the capabilities it lists only if you expect the tool to need them.
pandas is a PyPI package analyzed by SkillTotal's deterministic static scanner. The scan found no malicious indicators, though 1 risky construct is reported for review. It can: dynamic code execution, filesystem read, filesystem write, network egress and shell execution — capabilities are what the code can do, not a verdict on intent. Risk score 20/100 (low).
pandas 3.1.1
Get notified when this component changes
Change alerts aren't live yet. Leave your email and we'll let you know when they launch. We use it only for this and delete it on request.
Automated static-analysis result. It can contain false positives and false negatives, and is not a claim about the intent of pandas'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 (6)
It loads data with a format that can rebuild arbitrary objects (e.g. pickle, or unsafe YAML).
return pickle.load(handles.handle)
Why it matters: Feeding such a loader untrusted data can execute code hidden inside that data.
Fix: Deserialize untrusted data with a safe format/loader: JSON, or yaml.safe_load / Loader=SafeLoader. Reserve pickle/marshal for data you fully control.
The code turns strings into live code at runtime (eval / new Function / exec).
return str(CreateTable(self.table).compile(self.pd_sql.con))
Why it matters: If those strings aren't fixed and trusted, they become a way to run arbitrary code.
Fix: Avoid evaluating dynamically constructed code; if unavoidable, ensure the input is a trusted constant and never derived from external data.
The component can run operating-system commands or spawn processes.
raw_locales = subprocess.check_output(["locale", "-a"])
with subprocess.Popen(
["pbcopy", "w"], stdin=subprocess.PIPE, close_fds=True
) as p:with subprocess.Popen(
["pbpaste", "r"], stdout=subprocess.PIPE, close_fds=True
) as p:with subprocess.Popen(
["xclip", "-selection", selection], stdin=subprocess.PIPE, close_fds=True
) as p:with subprocess.Popen(
["xclip", "-selection", selection, "-o"],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
close_fds=True,
) as p:with subprocess.Popen(
["xsel", selection_flag, "-i"], stdin=subprocess.PIPE, close_fds=True
) as p:with subprocess.Popen(
["xsel", selection_flag, "-o"], stdout=subprocess.PIPE, close_fds=True
) as p:subprocess.check_call(args, close_fds=True)
p = subprocess.Popen(args, stdin=subprocess.PIPE, close_fds=True)
p = subprocess.Popen(args, stdout=subprocess.PIPE, close_fds=True)
with subprocess.Popen(
[
"qdbus",
"org.kde.klipper",
"/klipper",
"setClipboardContents",
text.encode(ENCODING),
],
stdin=sub …with subprocess.Popen(
["qdbus", "org.kde.klipper", "/klipper", "getClipboardContents"],
stdout=subprocess.PIPE,
close_fds=True,
) as p:with subprocess.Popen(["clip.exe"], stdin=subprocess.PIPE, close_fds=True) as p:
with subprocess.Popen(
["powershell.exe", "-command", "Get-Clipboard"],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
close_fds=True,
) as p:Why it matters: Powerful and often legitimate — confirm the commands aren't built from untrusted input.
Fix: Confirm the command and its arguments are fully controlled and not derived from untrusted input; avoid shell=True.
The component reads files from disk.
with open(path, encoding="utf-8") as fh:
with open(path, encoding="utf-8") as fh:
with open("/dev/clipboard", encoding="utf-8") as fd:handle = open(
handle,
ioargs.mode,
encoding=ioargs.encoding,
errors=errors,
newline="",
)handle = open(handle, ioargs.mode)
handle = open(handle, "rb")
with open(self.io, "rb"):
kwargs["open_with"] = lambda path, _: fsspec.open(
path, "wb", **(storage_options or {})
).open()with open(filepath, "rb") as fd:
with open(filepath, "rb") as fd:
with open(filepath, "rb") as fd:
with open(filepath, "rb") as fh:
with open(filepath, "rb") as fd:
with open(filepath, "rb") as fh:
buf = self._read_bytes(const.align_1_offset, const.align_1_length)
buf = self._read_bytes(const.align_2_offset, const.align_2_length)
buf = self._read_bytes(const.endianness_offset, const.endianness_length)
buf = self._read_bytes(const.encoding_offset, const.encoding_length)[0]
return self._read_bytes(offset, 1)[0]
buf = self._read_bytes(offset, text_block_size)
buf = self._read_bytes(offset1, self._lcp)
buf = self._read_bytes(offset1, self._lcp)
buf = self._read_bytes(offset1, self._lcp)
buf = self._read_bytes(offset1, self._lcs)
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.
with open(buf, "w", encoding="utf-8") as f:
with open("/dev/clipboard", "w", encoding="utf-8") as fd:with open(buf, "w", encoding=encoding, newline="") as f:
os.unlink(self._fname)
self._write_bytes(vl.generate_value_label(self._byteorder))
self._write_bytes(struct.pack("b", 114))self._write_bytes(struct.pack(byteorder + "h", self.nvar)[:2])
self._write_bytes(struct.pack(byteorder + "i", self.nobs)[:4])
self._write_bytes(self._null_terminate_bytes(_pad_bytes("", 80)))self._write_bytes(
self._null_terminate_bytes(_pad_bytes(data_label[:80], 80))
)self._write_bytes(self._null_terminate_bytes(ts))
self._write_bytes(struct.pack("B", typ))self._write_bytes(records.tobytes())
self._write_bytes(bytes("<stata_dta>", "utf-8"))self._write_bytes(self._tag(bio.getvalue(), "header"))
self._write_bytes(self._tag(bio.getvalue(), "map"))
self._write_bytes(self._tag(bio.getvalue(), "variable_types"))
self._write_bytes(self._tag(bio.getvalue(), "varnames"))
self._write_bytes(self._tag(b"\x00" * sort_size * (self.nvar + 1), "sortlist"))
self._write_bytes(self._tag(bio.getvalue(), "formats"))
self._write_bytes(self._tag(bio.getvalue(), "value_label_names"))
self._write_bytes(self._tag(bio.getvalue(), "variable_labels"))
self._write_bytes(self._tag(bio.getvalue(), "variable_labels"))
self._write_bytes(self._tag(b"", "characteristics"))
self._write_bytes(b"<data>")
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.request
return urllib.request.urlopen(*args, **kwargs) # noqa: TID251
import urllib.request
req_info = urllib.request.Request(filepath_or_buffer, headers=storage_options)
from urllib.request import pathname2url
return urljoin("file:", pathname2url(path))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.
How attackers abuse these capabilities
Interactive labs on the attack class behind the rules above. They show the technique, not anything found in pandas.
Maintain pandas?
The free Claude Code plugin scans each npm, PyPI or MCP package with this report's open-source engine before the install command runs. It runs on your machine and needs no account.
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 →