Closed tan9 closed 1 year ago
Thanks for your report! Please ensure you have provided enough info in order to recreate the issue, including the problematic ODS File.
Looks like the 3rd option is the best one. That's assuming this flag doesn't affect the existing usage. I guess not, otherwise we should be able to see it at unit tests.
Nevertheless, you said the flag should be set to true. But previously, in your workaround, you set the flag to false... Should it not be false?
Looks like the 3rd option is the best one. That's assuming this flag doesn't affect the existing usage. I guess not, otherwise we should be able to see it at unit tests.
I've submitted a pull request to address this change: https://github.com/miachm/SODS/pull/78
Nevertheless, you said the flag should be set to true. But previously, in your workaround, you set the flag to false... Should it not be false?
A correction is needed: to disable validation, set it to false
. Additionally, this prevents SODS from being vulnerable to an XXE attack.
However, #78 causes #80.
@miachm I've rebased the PR onto the master branch.
We require the
XMLInputFactory
configuration capability as described in https://github.com/miachm/SODS/issues/39.Context
Our application is deployed on JBoss EAP, which incorporates Woodstox as its StAX implementation. While attempting to parse .ods files with a Dtd declared in metadata.xml (which was generated by using JasperReports) like the following:
We encountered the following exception:
Please note that the exception above occurred due to this StAX implementation trying to validate the XML against the missed DTD resource, and this issue has been encountered during the process of reading and parsing the .ods file.
Workaround
I can verify that when we follow the provided instructions to configure Woodstox not to perform validation, the .ods file can be successfully read:
Discussion
Exploring ways to extend
XMLInputFactory
customization:Another strategy involves utilizing the
ServiceLoader
mechanism as demonstrated below:Or we can simply apply the mentioned patch directly to set
XMLInputFactory.SUPPORT_DTD
totrue
. This adjustment will ensure that JasperReports-generated ODS files function correctly on JBoss EAP without affecting any existing usages.Are there any alternative approaches that should be considered?