fix(security): sanitize CSV export to prevent formula injection - #293
Merged
jjaquish merged 1 commit intoAug 10, 2026
Merged
Conversation
RHCLOUD-49853 Neutralize spreadsheet formula injection in CSV exports by prefixing values starting with =, +, -, @, TAB, or CR with a single quote. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.
Description
Sanitize CSV export data in the
ExportsDropdowncomponent to prevent spreadsheet formula injection (CSV injection / DDE injection). Values starting with formula trigger characters (=,+,-,@, TAB, CR) are now prefixed with a single quote so spreadsheets treat them as literal text instead of formulas.RHCLOUD-49853
Screenshots
No UI changes — pure logic fix.
Anything reviewers should know?
sanitizeCsvValueutility prefixes dangerous values with a single quote ('), which is the standard OWASP-recommended approach for CSV formula neutralization. The quote is visible in the raw CSV but is silently consumed by Excel/LibreOffice as a "text prefix" indicator.useMemokeyed onpayloadsfor performance — no re-computation on unrelated re-renders.react-csv@1.1.2(currently pinned) does not perform any formula neutralization itself; it only applies CSV quoting.status_msg,service,source— any free-text field that a tenant could control.Checklist
AI disclosure
Assisted by: Claude Code