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

Disable "strings to Formula" by default #663

Closed
randomstuff opened this issue Oct 24, 2019 · 1 comment
Closed

Disable "strings to Formula" by default #663

randomstuff opened this issue Oct 24, 2019 · 1 comment
Assignees
Labels

Comments

@randomstuff
Copy link

By default, XlsxWriter expands cells starting with = into formulas. Having this behavior happen by default is dangerous as it makes it easy to write code which is vulnerable to formula injections. Wouldn't it be safer to make this an opt-in instead?

See pandas-dev/pandas#29095

@jmcnamara jmcnamara self-assigned this Oct 24, 2019
@jmcnamara
Copy link
Owner

jmcnamara commented Oct 24, 2019

Converting strings to formulas in write() is the documented behaviour and has been for 6 years. Changing it now would break that functionality for a large number of users, so I'm not going to do that.

This behaviour is easily turned off in the constructor:

workbook = xlsxwriter.Workbook(filename, {'strings_to_formulas': False})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants