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

Prevent Java deserialization of internal classes #1991

Conversation

Marcono1234
Copy link
Collaborator

@Marcono1234 Marcono1234 commented Oct 11, 2021

ℹ️ Edit: See #1991 (comment) below for a more in-depth description of the impact.


Adversaries might be able to forge data which can be abused for DoS attacks.
These classes are already writing a replacement JDK object through writeReplace() during serialization for a long time (multiple years), so this change should not cause any issues.

I have not added tests for the prevented deserialization because it would require hardcoding the binary deserialization data which would decrease transparency of this project.

Adversaries might be able to forge data which can be abused for DoS attacks.
These classes are already writing a replacement JDK object during serialization
for a long time, so this change should not cause any issues.
@google-cla google-cla bot added the cla: yes label Oct 11, 2021
@eamonnmcmanus
Copy link
Member

This makes sense. Thanks!

@eamonnmcmanus eamonnmcmanus merged commit e6fae59 into google:master Oct 13, 2021
@Marcono1234 Marcono1234 deleted the marcono1234/java-deserialization-internal-classes branch October 13, 2021 19:18
sakibguy added a commit to sakibguy/gson that referenced this pull request Oct 14, 2021
Prevent Java deserialization of internal classes (google#1991)
This was referenced Nov 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants