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

upgrade libxstream-java to version 1.4.18 because of earlier security vulnerabilities #2071

Open
apoleon opened this issue Sep 28, 2021 · 0 comments
Labels

Comments

@apoleon
Copy link

apoleon commented Sep 28, 2021

XStream switched from a security blacklist to a whitelist which is more secure in 1.4.18 to block malicious code from being de-serialized.

Quote from upstream:

"Main reason for the blacklist were compatibility, it allowed to use newer versions of XStream as drop-in replacement. However, this approach has failed. A growing list of security reports has proven, that a blacklist is inherently unsafe, apart from the fact that types of 3rd libraries were not even considered. XStream provides the ability to setup a whitelist since version 1.4.7, a version released nine years before 1.4.18. Clients who have adapted their setup and initialize the security framework are able to use newer versions again as drop-in replacement. A blacklist scenario should be avoided in general, because it provides a false sense of security."

jajuk does not use a whitelist so far but this has been the recommended way for years now. You just need to update XMLUtils.java to allow Jajuk classes.

It looks to me you just need to update the readObjectFromFile method, e.g you could allow all classes from the same package like that:

xStream.allowTypesByWildcard(new String[] {XMLUtils.class.getPackage().getName()+".*" });

After that everything should work as before.

See also https://x-stream.github.io/security.html#framework

gkerdal added a commit that referenced this issue Jul 20, 2022
bflorat added a commit that referenced this issue Jul 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants