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

Escape formulae on export #540

Merged
merged 7 commits into from
Mar 3, 2023

Conversation

matthewhegarty
Copy link
Contributor

There is a potential security flaw where XLSX files can be exported with active formulae (see #257).

This PR adds an optional 'escape' kwarg to the export method which will strip leading '=' characters and disable formulae.

Tests included.

@codecov
Copy link

codecov bot commented Mar 1, 2023

Codecov Report

Merging #540 (080b55a) into master (4363c43) will increase coverage by 0.12%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master     #540      +/-   ##
==========================================
+ Coverage   91.15%   91.28%   +0.12%     
==========================================
  Files          28       28              
  Lines        2680     2719      +39     
==========================================
+ Hits         2443     2482      +39     
  Misses        237      237              
Impacted Files Coverage Δ
src/tablib/formats/_xlsx.py 97.02% <100.00%> (+0.06%) ⬆️
tests/test_tablib.py 98.72% <100.00%> (+0.05%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@matthewhegarty matthewhegarty marked this pull request as ready for review March 1, 2023 14:49
tests/test_tablib.py Show resolved Hide resolved
tests/test_tablib.py Outdated Show resolved Hide resolved
@claudep
Copy link
Contributor

claudep commented Mar 1, 2023

Thanks for the patch! Could you please also complete the docs in formats.rst?

@matthewhegarty
Copy link
Contributor Author

Thanks for the patch! Could you please also complete the docs in formats.rst?

Done. To avoid duplication I added links to the source docstrings.

Also updated requirements.txt to the latest version of 'Sphinx'

Copy link
Contributor

@claudep claudep left a comment

Choose a reason for hiding this comment

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

That looks very good, thanks!

@claudep
Copy link
Contributor

claudep commented Mar 3, 2023

@hugovk, I let you do the merge if you find it OK.

@hugovk hugovk merged commit bff435d into jazzband:master Mar 3, 2023
@hugovk
Copy link
Member

hugovk commented Mar 3, 2023

Thanks!

@matthewhegarty
Copy link
Contributor Author

Is there a timeline for releasing this? Sorry to ask but we have a downstream security issue relating to this. Any updates greatly appreciated.

@claudep
Copy link
Contributor

claudep commented Mar 18, 2023

I guess someone has to complete the HISTORY file, but then I think we could release soonish...

@hugovk
Copy link
Member

hugovk commented Mar 23, 2023

@matthewhegarty If you can make a PR to update HISTORY.md, that would help us release much quicker :)

@matthewhegarty
Copy link
Contributor Author

#544 👍

@hugovk
Copy link
Member

hugovk commented Mar 24, 2023

Thank you, now released in 3.4.0! 🚀

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

Successfully merging this pull request may close these issues.

3 participants