WarUI

Formula injection neutralization

GRID-A20-F06P0beyond-baselinePlanned

Spreadsheet exports (CSV and XLSX string cells) neutralize values that begin with =, +, -, @, tab or carriage return by default, so a spreadsheet application cannot evaluate them as formulas. The strategy is configurable, and it can be disabled only explicitly, with a documented warning.

Planned. This page shows the specification from issue #200. The live example, source for every framework and the API reference replace it when the feature ships.

Live example

Grid seeded with malicious-looking values ('=1+1', '+SUM(A1)', '-2+3', '@cmd', a value starting with a tab) and legitimate negative numbers.

Expected behavior

With the default settings, risky strings are prefixed with a single quote, while numeric cells such as -5 stay numeric. Turning sanitizing off shows a visible warning and exports values unmodified.

Planned API surface

exportOptions.sanitizeFormulasexportOptions.formulaTriggerCharsexportOptions.formulaEscapeStrategy'prefixQuote' | 'prefixSpace' | 'strip'column.allowFormula

Acceptance criteria

  • sanitizeFormulas defaults to true for CSV and XLSX. (pending)
  • String values whose first character is in formulaTriggerChars (default = + - @ \t \r) are escaped using the configured strategy. (pending)
  • Values typed as numbers are never altered, so -5 remains -5. (pending)
  • Numeric-looking strings such as '-5' in a string column are escaped, and this behaviour is documented. (pending)
  • JSON export is not affected. (pending)
  • column.allowFormula:true exempts only that column, and only in XLSX formula cells. (pending)
  • Disabling sanitizing logs a one-time console warning. (pending)