
CSV Security Risks That Catch Teams Out and What to Do
How a CSV file hurts a team: formula injection, hostile uploads, leaked personal data, hidden payloads and risky loaders, with a fix and a check for each.
Tag
43 posts

How a CSV file hurts a team: formula injection, hostile uploads, leaked personal data, hidden payloads and risky loaders, with a fix and a check for each.

See an f-string builder turn a YAML job file into a dropped table, then fix it with bound values, quoted identifiers and an allow-list of tables.

Extract the patient id and measurements from a synthetic CDA clinical document with a namespace map, handle nullFlavor and disable entity resolution.

Flatten Kubernetes Deployments into one row per container and audit limits, probes, latest tags and privileged mode with SQL, then rank workloads by findings.

Where each parser sets its alias limit: SnakeYAML options, Go's built-in check, Ruby's aliases flag, DuckDB's node budget and a PyYAML guard, all tested.

A 40-line guard for accepting YAML uploads: size cap, UTF-8, safe parsing, expanded-size and depth limits, then key checks. Ten test inputs and what each did.

Check an Excel upload before parsing: size, name, zip signature, required parts, macro parts, sheet names and header row, in a fixed order with clear errors.

Read password protected Excel files from a script with msoffcrypto-tool, tell file encryption from sheet protection, and keep passwords out of code and logs.

What to do when a token lands in a values or config YAML: removing it from the file leaves it in history, gitleaks finds it, and rotation is the real fix.

Stop zip bombs and oversized xlsx uploads with limits on file size, entry count, expansion ratio and rows, enforced before parsing and sized from real files.

Open untrusted Excel files in a sandboxed worker with no network, memory and time limits, a read-only parser and no desktop Excel, then load results as data.

Which function to call in PyYAML, Ruby Psych and SnakeYAML to load untrusted YAML safely, what each default does and how to grep for the unsafe ones.