Hub rules-pandas

rules-pandas

v3 public Verified

pandas

pandas is a powerful data analysis and manipulation library for Python. These rules govern data frame operations, indexing strategies, and efficient statistical analysis of structured data.

@sigmashakeinc 2 pulls 7 rules published Apr 8, 2026 synced Oct 11, 2026 sigmashakeinc/rules/rulesets/rules-pandas →
Severity
4 error 2 warn 1 info
demo.cast
pandas is a powerful data analysis and manipulation library for Python. These rules govern data frame operations, indexing strategies, and efficient statistical analysis of structured data.

Rules index

7 governance rules

Indexed from the repository's .rules files, grouped by technology. Expand any rule to read the raw source.

pandas

no-pandas-eval-injection warning ask

pd.eval() / DataFrame.eval() executes an arbitrary expression string against the DataFrame. If the expression is built from user input, this is a code execution vulnerability. Use vectorised pandas operations or boolean indexing instead of eval() with dynamic strings.

Rule source requires an active Pro or Enterprise subscription.
no-pandas-hardcoded-db-credentials error log

Hardcoded database password in SQLAlchemy connection string or pandas DB call. Credentials in source files are exposed via git history and process listings. Use environment variables: create_engine(os.environ['DB_URL']) or a secrets manager.

Rule source requires an active Pro or Enterprise subscription.
no-pandas-pickle-load error block

pd.read_pickle() deserializes arbitrary Python objects using the pickle protocol — a critical RCE vector (CWE-502). A malicious .pkl file can execute arbitrary code on load. Use pd.read_parquet(), pd.read_csv(), or pd.read_feather() for safe serialization formats.

Rule source requires an active Pro or Enterprise subscription.
no-pandas-query-injection error log

DataFrame.query() with string interpolation or concatenation. Building query strings from user input enables expression injection — query() uses a numexpr/pandas parser that can execute arbitrary Python. Use the @variable syntax to safely pass values: df.query('col == @value').

Rule source requires an active Pro or Enterprise subscription.
no-pandas-read-sql-injection error block

pd.read_sql() with a dynamically constructed query string is vulnerable to SQL injection (CWE-89). Pass parameters via the 'params' argument rather than string interpolation: pd.read_sql('SELECT * FROM t WHERE id = %s', conn, params=[user_id]).

Rule source requires an active Pro or Enterprise subscription.
warn-pandas-deprecated-panel info log

pandas.Panel was removed in pandas 1.0 (deprecated since 0.25). Replace with a MultiIndex DataFrame or xarray.DataArray.

Rule source requires an active Pro or Enterprise subscription.
warn-pandas-read-clipboard warning log

pd.read_clipboard() reads from the system clipboard — a non-reproducible, environment-dependent data source unsuitable for any code that runs in CI or production. Replace with pd.read_csv() from a checked-in fixture file.

Rule source requires an active Pro or Enterprise subscription.

Version metadata

Published metadata

The hash-locked record of this published ruleset. When source contents change, the maintainer resyncs and the version bumps.

Version
v3
Published
Apr 8, 2026
Source commits
0
Synced
Oct 11, 2026
Hash
acda39bef7330a57f78a552d656626fe664d8aba1777fa0945f25f0726900138
Signature
Verified (publisher key)
Tested with
claude-code@current
Plan
Starter (free)
Visibility
Public

Source history

Recent commits

Latest commits touching rulesets/rules-pandas/.sigmashake/rules in sigmashakeinc/rules/rulesets/rules-pandas. The published version only bumps when a maintainer resyncs.

No commit history available.