fix(security): neutralize CSV formula injection in logs export#4952
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryLow Risk Overview Logs export ( Table export drops its inline copy of the same helper and imports the shared module; CSV cell behavior is unchanged. Reviewed by Cursor Bugbot for commit 8e8bb12. Configure here. |
Greptile SummaryThis PR closes a stored CSV formula-injection vector in
Confidence Score: 5/5Safe to merge — the change is a targeted security hardening with no behavioural regressions; the only modified logic is the string branch of All three files have narrow, well-scoped changes: a new four-line utility, one extra import plus one-line branch in the logs export, and a dead-code removal in the table export. The neutralization is applied at the correct point in the pipeline (before RFC-4180 quoting), non-string values are correctly left on the numeric path, and the shared function is identical to the original inline version it replaces. No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Cell value] --> B{typeof value}
B -- string --> C[neutralizeCsvFormula]
B -- number or boolean --> D[String coercion]
C --> E{Starts with trigger char?}
E -- yes --> F[Prefix with single-quote]
E -- no --> G[Unchanged]
F --> H[RFC-4180 CSV quoting]
G --> H
D --> H
H --> I{Contains special chars?}
I -- yes --> J[Wrap in double-quotes and escape]
I -- no --> K[Emit verbatim]
J --> L[CSV field output]
K --> L
Reviews (3): Last reviewed commit: "fix(csv): only neutralize string cells i..." | Re-trigger Greptile |
|
@greptile |
|
@cursor review |
|
@greptile |
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 8e8bb12. Configure here.
Summary
=,+,-,@, tab, CR) inGET /api/logs/exportCSV output by prefixing affected cells with a single quoteneutralizeCsvFormula()already used in the table export routeType of Change
Testing
Tested manually
Checklist