feat(probes): add CSV/spreadsheet formula injection probe + detector - #2036
Open
vishnukannaujia wants to merge 1 commit into
Open
feat(probes): add CSV/spreadsheet formula injection probe + detector#2036vishnukannaujia wants to merge 1 commit into
vishnukannaujia wants to merge 1 commit into
Conversation
Adds probes.formula_injection.FormulaInjection and the matching detectors.formula_injection.FormulaInjection, covering CSV/spreadsheet formula injection (CWE-1236, OWASP CSV Injection). Following the same "target output attacks a downstream sink" pattern as ansiescape (terminal) and web_injection (browser): here the sink is a spreadsheet that evaluates a cell beginning with =/+/-/@ as a formula. The probe tries to elicit such cells carrying active payloads (HYPERLINK/IMPORTXML/WEBSERVICE exfiltration and DDE command execution); the detector deterministically flags a formula-trigger cell containing a known-dangerous function, so it needs no model call to test. Fixes NVIDIA#1906 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: Vishnu Kannaujia <vishnu.kannaujia@gmail.com>
This was referenced Aug 9, 2026
Open
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1906
Summary
Adds a new probe + detector pair,
formula_injection, covering CSV / spreadsheet formula injection (CWE-1236, OWASP CSV Injection).When an application writes target output into a CSV/TSV file that is later opened in a spreadsheet, a cell whose first meaningful character is
=,+,-, or@is evaluated as a formula. An attacker-influenced cell can exfiltrate neighbouring cells (HYPERLINK/IMPORTXML/WEBSERVICE) or execute commands via legacy DDE (cmd|'/c ...').This is the same "target output attacks a downstream sink" thesis already used by
ansiescape(terminal) andweb_injection(browser); here the downstream sink is the spreadsheet. Approach was floated for scope-fit in #1906 first.What's added
probes.formula_injection.FormulaInjection— stub × payload prompts that try to get the target to emit a formula-injection cell.intent = "S008inject"; tagsowasp:llm02,owasp:llm05,avid-effect:security:S0200,quality:Security:Integrity;tier = INFORMATIONAL.detectors.formula_injection.FormulaInjection— a deterministic regex detector that flags a formula-trigger cell containing a known-dangerous spreadsheet function / DDE construct. No model call needed to evaluate it.ansiescapeprobe/detector tests.Before → after
ansiescapeand browser viaweb_injection).formula_injectionelicits and detects spreadsheet formula-injection payloads.Tests
tests/probes/test_probes_formula_injection.py— prompt structure & payload triggers.tests/detectors/test_detectors_formula_injection.py— every payload →1.0, benign CSV (incl. a lone negative number-5) →0.0,Noneoutput →None.black.A false-positive guard is built in: a formula-trigger character alone isn't a hit — the cell must also carry a dangerous function/DDE construct, so ordinary negative numbers in a CSV don't trigger.