You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Take XML vulnerabilities into consideration, when parsing XLSX
There are many attack vectors targeting XML parsers; by default most are susceptible to all or most of the known vulnerabilities. There is DefuseXML Python library to help mitigate against attacks by malicious XML files obtained from non-trusted sources. When working with XLSX documents using xlrd, following wrapper can be used to harden against these attacks.
importdefusedxmlfromdefusedxml.commonimportEntitiesForbiddenfromxlrdimportopen_workbookdefusedxml.defuse_stdlib()
defsecure_open_workbook(**kwargs):
try:
returnopen_workbook(**kwargs)
exceptEntitiesForbidden:
raiseValueError('Please use a xlsx file without XEE')
The text was updated successfully, but these errors were encountered:
Take XML vulnerabilities into consideration, when parsing XLSX
There are many attack vectors targeting XML parsers; by default most are susceptible to all or most of the known vulnerabilities. There is DefuseXML Python library to help mitigate against attacks by malicious XML files obtained from non-trusted sources. When working with XLSX documents using xlrd, following wrapper can be used to harden against these attacks.
The text was updated successfully, but these errors were encountered: