T09 · Insecure Skill Coding Practices
- Location
SKILL.md:148- Finding
Spreadsheet Formula Injection in Generated CSV Files
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 148-177
Vulnerability Type: CSV/spreadsheet formula injection
Risk Level: MediumVulnerable Documentation Excerpt
The following is an English translation of the relevant Skill instructions:
text - Excel-specific defenses: formula injection (`=+-@`), 15-digit precision loss, and scientific notation are paid-edition features. | Formula injection risk | Field starts with `=+-@` | The free edition provides no defense; the paid edition adds an apostrophe prefix. | Q4: How can Excel formula injection be prevented? The free edition provides no formula-injection defense. The paid edition adds an apostrophe prefix to fields starting with `=+-@`.Technical Analysis
The Skill generates CSV data intended for consumption by spreadsheet applications, but it explicitly leaves formula-prefixed fields unmitigated. CSV quoting and RFC 4180 compliance do not prevent applications such as Excel from interpreting cell values beginning with
=,+,-, or@as formulas.Consequently, an attacker who controls a field value can insert a spreadsheet formula into an otherwise valid CSV record. The generated file can remain syntactically correct while becoming dangerous when opened in a spreadsheet. The Skill also directs users to validate generated files in their target tool, increasing the likelihood that unsafe content will be opened.
Attack Path
- An attacker controls or influences a value included in data processed by the Skill.
- The attacker supplies a value beginning with a spreadsheet formula marker, such as
=,+,-, or@. - The Skill emits the field without spreadsheet-safe neutralization because the documented free workflow provides no defense.
- A user opens the generated CSV in Excel or another formula-evaluating spreadsheet application.
- The application interprets the attacker-controlled value as a formula. 6 ...[truncated 819 chars]
- Remediation
View remediation
Remediation Suggestions
- Apply spreadsheet-formula neutralization by default whenever CSV output may be opened in a spreadsheet.
- Detect dangerous prefixes including
=,+,-, and@. Account for leading whitespace, tabs, and control characters that may precede a formula marker. - Provide a clearly documented spreadsheet-safe export mode that prefixes dangerous values using a target-compatible mechanism, such as an apostrophe where appropriate.
- Do not reserve injection prevention for a paid edition; baseline security protections should be enabled in every edition.
- Warn users when potentially executable spreadsheet content is detected, and report which records and columns were affected.
- Preserve an explicit raw-data mode only when necessary, require opt-in confirmation, and explain that raw output must not be opened directly in formula-evaluating applications.
- Add tests covering formula markers, leading whitespace and control characters, quoted formulas, embedded newlines, and application-specific parsing behavior.
