fix(ui): guard leading tab and CR in escapeCsvCell against formula injection#7452
fix(ui): guard leading tab and CR in escapeCsvCell against formula injection#7452jaytbarimbao-collab wants to merge 1 commit into
Conversation
…jection escapeCsvCell only prefixed the anti-formula "'" when a value started with =, +, -, or @. A spreadsheet strips a leading TAB (\t) or CR (\r) and still evaluates the formula that follows, so a telemetry-sourced value like "\t=HYPERLINK(...)" slipped past the guard unescaped. Extend the guard regex to /^[=+\-@\t\r]/ so a leading tab or CR is guarded the same way. Closes JSONbored#7439
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
|
Caution 🛑 LoopOver review result - fixes requiredReview updated: 2026-07-20 11:02:49 UTC
Review summary Nits — 4 non-blocking
CI checks failing
Decision drivers
Context & advisory signals — never blocks the verdict
Linked issue satisfactionAddressed Review context
Contributor next steps
Signal definitions
🧪 Chat with LoopOverAsk LoopOver a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.
Full command reference: https://loopover.ai/docs/loopover-commands 🧪 Experimental — new and may change. 🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by LoopOver, a quiet PR intelligence layer for OSS maintainers.
|
|
LoopOver is closing this pull request on the maintainer's behalf (CI is failing (validate, validate-code)). This is an automated maintenance action — to pursue this change, please open a new pull request with the issues resolved. Closed PRs may be analyzed later to improve review accuracy, but they are not automatically reopened or re-reviewed. |
Summary
escapeCsvCell(apps/loopover-ui/src/lib/csv-export.ts) guards spreadsheet formula-injection by prefixing'when a value starts with=,+,-, or@. But a leading TAB (\t) or CR (\r) is also a formula-injection vector: a spreadsheet strips the leading whitespace and still evaluates the=/+/-/@formula that follows, so a telemetry-sourced value like"\t=HYPERLINK(\"evil\")"slipped past the guard unescaped.Fix
Extend the guard regex from
/^[=+\-@]/to/^[=+\-@\t\r]/, so a leading tab or CR is guarded the same way. No other behavior changes — RFC-4180 quoting is unchanged (a\rvalue still additionally quotes as before).Verification
csv-export.test.tsgains a#7439case asserting"\t=1+1"→"'\t=1+1","\t@SUM(A1)"→"'\t@SUM(A1)","\r=1+1"→ quoted-and-guarded, and that a plain value is untouched. All 7 csv-export tests pass.Closes #7439