Skip to content

Conversation

hazendaz
Copy link
Member

Fixes https://github.com/mybatis/mybatis-3/security/code-scanning/6

To fix the problem, we need to disable the parsing of external entities and DTDs in the DocumentBuilderFactory configuration. This can be achieved by setting the appropriate features on the DocumentBuilderFactory instance. Specifically, we need to set the http://apache.org/xml/features/disallow-doctype-decl feature to true and the http://xml.org/sax/features/external-general-entities and http://xml.org/sax/features/external-parameter-entities features to false.

Suggested fixes powered by Copilot Autofix. Review carefully before merging.

…controlled data

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@hazendaz
Copy link
Member Author

auto suggested, doesn't work though.

@hazendaz hazendaz closed this Dec 26, 2024
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.

1 participant