-
Notifications
You must be signed in to change notification settings - Fork 0
π‘οΈ Sentinel: [HIGH] Fix CSV formula injection null byte bypass #1014
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -23,7 +23,8 @@ export function sanitizeFilename(title: string): string { | |
| export function escapeCsvField(value: string): string { | ||
| let escapedValue = value; | ||
| // Prevent CSV formula injection by prefixing problematic leading characters with a single quote | ||
| if (/^[\s\uFEFF\xA0]*[=+\-@\t\r\n]/.test(value)) { | ||
| // eslint-disable-next-line no-control-regex | ||
| if (/^[\s\uFEFF\xA0]*[=+\-@\t\r\n\x00]/.test(value)) { | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. π Info: Only leading null bytes are neutralized The regex Was this helpful? React with π or π to provide feedback. |
||
| escapedValue = `'${value}`; | ||
| } | ||
| // Enclose in double quotes if there's a comma, newline, or double quote | ||
|
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
π‘ Incomplete export Security Notes
Export changes require
Security Notescovering boundaries, validation, safe failure, logging/privacy, and tests. The existing note omits several required review points.Prompt for agents
Was this helpful? React with π or π to provide feedback.