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

Restrict allowed classes during deserialization of signature files #253

Merged
merged 3 commits into from
Dec 26, 2023
Merged

Restrict allowed classes during deserialization of signature files #253

merged 3 commits into from
Dec 26, 2023

Conversation

Marcono1234
Copy link
Contributor

@Marcono1234 Marcono1234 commented Jul 6, 2023

Because signature files are created using Java Serialization, adds a new SignatureObjectInputStream which restricts the classes which are allowed to be loaded when reading signature files to increase security.

I hope these changes are fine security-wise, but please let me know if I overlooked something or failed to consider something.

I have tested these changes with the following signatures to make sure that they can still be loaded successfully:

But feel free to perform additional tests to be safe

Relates to #252
But I don't think this resolves that issue fully or renders it obsolete. A different file format which is inherently safer would still be better than having to implement additional security measures on top of Java Serialization, as done in this pull request.

Because signature files are created using Java Serialization, adds a new
`SignatureObjectInputStream` which restricts the classes which are allowed
to be loaded when reading signature files to increase security.
@Marcono1234
Copy link
Contributor Author

Thanks for your reviews! I just noticed a small typo in the tests and have pushed a commit for that and merged the changes from master into this branch; I hope that is ok. Please let me know if I should squash the commits of this PR.

@slachiewicz slachiewicz merged commit 4b5dd40 into mojohaus:master Dec 26, 2023
49 checks passed
@Marcono1234 Marcono1234 deleted the marcono1234/deserialization-restrictions branch December 26, 2023 20:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants