Skip to content

Prevent XMLDecoder from loading other than whitelisted classes #3526

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

Merged
merged 2 commits into from
Apr 7, 2021

Conversation

ahornace
Copy link
Contributor

@ahornace ahornace commented Apr 7, 2021

Creating this as a draft because this fix is only a workaround. I'm not really sure I whitelisted all the possible classes and I do not know how to achieve this more nicely. I think we can use this as an interim solution until we get the yaml config working.

Thanks to Bobby Rauch (Accenture) for reporting the issue.

@vladak
Copy link
Member

vladak commented Apr 7, 2021

The #2329 will be the final fix (YAML or some custom format).

@ahornace ahornace marked this pull request as ready for review April 7, 2021 11:59
@Test
void testLoadingValidConfiguration() throws IOException {
try (var br = new BufferedReader(new InputStreamReader(ConfigurationTest.class.getClassLoader()
.getResourceAsStream("configuration/valid_configuration.xml")))) {
Copy link
Member

Choose a reason for hiding this comment

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

would be more robust to encode a Configuration instance and store it in the file however let's leave it like it is for now.

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.

2 participants