Skip to content
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

Use EscapeFormula() in CSV export #11901

Merged
merged 4 commits into from
Sep 30, 2022
Merged

Conversation

snipe
Copy link
Owner

@snipe snipe commented Sep 30, 2022

This uses the EscapeFormula() method built into the CSV exporter to escape Excel formulas, which in general is good practice, HOWEVER, some folks might be using formulas as fields on purpose, so I've also included an .env override so that admins can override this behavior if they need to. This value defaults to true if CSV_ESCAPE_FORMULAS is set to true or or not set at all in the .env (which would be common for people upgrading who never added it to their .env.)

This addresses the low-severity CSV injection huntr.dev report here reported by @Vautia, which does not seem to be reproducible in Excel or LibreOffice, just OpenOffice (so far.)

Signed-off-by: snipe <snipe@snipe.net>
Signed-off-by: snipe <snipe@snipe.net>
@snipe snipe changed the title Use EscapeFormula() in CSV export Use EscapeFormula() in CSV export Sep 30, 2022
Signed-off-by: snipe <snipe@snipe.net>
Signed-off-by: snipe <snipe@snipe.net>
@snipe snipe merged commit b9419c7 into develop Sep 30, 2022
@snipe snipe deleted the security/escape_formats_in_csv branch September 30, 2022 18:59
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.

None yet

1 participant