Skip to content

feat(security): add sanitizeCsvCell utility function - #3102

Merged
b-l-i-n-d merged 1 commit into
4.2.0from
feat/async-analytics-report
Oct 16, 2026
Merged

b-l-i-n-d merged 1 commit into
4.2.0from
feat/async-analytics-report

Conversation

@b-l-i-n-d

Copy link
Copy Markdown
Collaborator

No description provided.

@b-l-i-n-d b-l-i-n-d self-assigned this Oct 16, 2026
/**
* Formula injection prevention prefixes (OWASP / CWE-1236)
*/
const FORMULA_INJECTION_PREFIXES = ['=', '+', '-', '@', '\t', '\r'] as const;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks unnecessary.

@b-l-i-n-d b-l-i-n-d Oct 16, 2026 •

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's used inside sanitizeCsvCell. There is a small benefit to declaring it outside the function.

if (FORMULA_INJECTION_PREFIXES.some((prefix) => str.startsWith(prefix))) {
    str = `'${str}`;
  }

@b-l-i-n-d
b-l-i-n-d merged commit 94dff22 into 4.2.0 Oct 16, 2026
0 of 3 checks passed
@b-l-i-n-d
b-l-i-n-d deleted the feat/async-analytics-report branch October 16, 2026 09:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants