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

FEATURE_SECURE_PROCESSING threshold too low in XmlDecoder #554

Closed
dr0i opened this issue Jul 16, 2024 · 5 comments · Fixed by #555
Closed

FEATURE_SECURE_PROCESSING threshold too low in XmlDecoder #554

dr0i opened this issue Jul 16, 2024 · 5 comments · Fixed by #555
Assignees

Comments

@dr0i
Copy link
Member

dr0i commented Jul 16, 2024

Got:

<=<=Exception in thread "main" org.metafacture.framework.MetafactureException: org.xml.sax.SAXParseException; lineNumber: 8496675; columnNumber: 3876; JAXP00010004: Die akkumulierte Größe von Entitys ist "50.000.001" und überschreitet den Grenzwert "50.000.000", der von "FEATURE_SECURE_PROCESSING" festgelegt wurde.
at org.metafacture.xml.XmlDecoder.process(XmlDecoder.java:79)
at org.metafacture.xml.XmlDecoder.process(XmlDecoder.java:44)
at org.metafacture.io.FileOpener.process(FileOpener.java:158)
at org.metafacture.io.FileOpener.process(FileOpener.java:41)
at org.metafacture.flux.parser.StringSender.process(StringSender.java:43)
at org.metafacture.flux.parser.Flow.start(Flow.java:118)
at org.metafacture.flux.parser.FluxProgramm.start(FluxProgramm.java:168)
at org.metafacture.runner.Flux.main(Flux.java:87)
Caused by: org.xml.sax.SAXParseException; lineNumber: 8496675; columnNumber: 3876; JAXP00010004: Die akkumulierte Größe von Entitys ist "50.000.001" und überschreitet den Grenzwert "50.000.000", der von "FEATURE_SECURE_PROCESSING" festgelegt wurde.
at java.xml/com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1243)
at java.xml/com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:635)
at org.metafacture.xml.XmlDecoder.process(XmlDecoder.java:73)

when analyzing Alma Basedump in a single process.

@dr0i dr0i added Bug and removed Bug labels Jul 16, 2024
@dr0i dr0i added this to Metafacture Jul 16, 2024
@dr0i dr0i moved this to Selected in Metafacture Jul 16, 2024
@dr0i dr0i self-assigned this Jul 16, 2024
@blackwinter
Copy link
Member

@dr0i
Copy link
Member Author

dr0i commented Jul 18, 2024

Thx @blackwinter - I have hoped there is a setting :)
So, using the runner we change its build.gradle to:
applicationDefaultJvmArgs = ["-agentlib:hprof=heap=sites,cpu=samples,depth=${depth},cutoff=${cutoff},file=${file}.hprof.txt -Dinvokejdk.xml.totalEntitySizeLimit=0"] (EDIT dr0i: this is not working. Try JAVA_TOOL_OPTIONS=-Djdk.xml.totalEntitySizeLimit=0 ./gradlew :metafix-runner:run --args="$pathToFlux" )?

May we think about:
a) making this default
b) introducing a parameter for XmlDecoder

@blackwinter
Copy link
Member

Changing the JVM args in the Metafix runner is effectively your option a), right? That's a 👎 from me. Since this is a security-related setting, it should be the user's decision to relax any limits.

We might want to introduce a setter for a more targeted approach - your option b) - instead of requiring to set the limit globally. But that's just a convenience feature, isn't it?

@dr0i
Copy link
Member Author

dr0i commented Jul 18, 2024

But that's just a convenience feature, isn't it?

It's definitely convenient, but not only that: it also make the restrictions of XmlDecoder more overt to users so that they may circumvent this restriction even before they ran one such big ETL erroring.

@dr0i dr0i moved this from Selected to Ready in Metafacture Jul 18, 2024
@blackwinter
Copy link
Member

Okay, no objection to making this limit more discoverable.

@blackwinter blackwinter removed their assignment Jul 22, 2024
dr0i added a commit that referenced this issue Aug 30, 2024
dr0i added a commit that referenced this issue Aug 30, 2024
This has lesser implications. Also, some more declarations can be made "final".
Thx @blackwinter.
dr0i added a commit that referenced this issue Aug 30, 2024
This brings the comment of how to set the variable to allow unlimited entities
into flux-commands.md.
@dr0i dr0i closed this as completed in #555 Sep 2, 2024
@github-project-automation github-project-automation bot moved this from Ready to Done in Metafacture Sep 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants