-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
Ensure Serializable Security Components declare serialVersionUID #16276
Comments
jzheaux
added
status: waiting-for-triage
An issue we've not yet triaged
type: enhancement
A general enhancement
labels
Dec 13, 2024
jzheaux
added a commit
that referenced
this issue
Dec 13, 2024
jzheaux
added a commit
that referenced
this issue
Dec 13, 2024
This allows testing of classes that are serializable, but do not use Security's serialVersionUID. Issue gh-16276
jzheaux
added a commit
that referenced
this issue
Dec 13, 2024
Here is an example: e3cd433 |
jzheaux
added a commit
to jzheaux/spring-security
that referenced
this issue
Dec 13, 2024
jzheaux
added a commit
to jzheaux/spring-security
that referenced
this issue
Dec 13, 2024
jzheaux
added a commit
that referenced
this issue
Dec 13, 2024
jzheaux
added a commit
that referenced
this issue
Dec 13, 2024
jzheaux
added a commit
that referenced
this issue
Dec 14, 2024
The following inner classes are used only internally by a non-Serializable component Issue gh-16276
This was referenced Dec 16, 2024
jzheaux
added a commit
that referenced
this issue
Dec 17, 2024
jzheaux
added a commit
that referenced
this issue
Dec 17, 2024
jzheaux
added
in: core
An issue in spring-security-core
type: bug
A general bug
and removed
status: waiting-for-triage
An issue we've not yet triaged
type: enhancement
A general enhancement
labels
Dec 17, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To ensure backward compatibility, Security components that implement
Serializable
should have aserialVersionUID
.Based on internal testing across a few dozen JVMs, it appears that the
serialVersionUID
is consistent for Security's components. As such, we can safely add the calculatedserialVersionUID
value to each class that is missing it during the 6.4.x maintenance cycle.Serializable
classes missingserialVersionUID
Serializable
class is missing aserialVersionUID
When addressing a class that is missing its
serialVersionUID
, please do the following:Add the calculated
serialVersionUID
(IDEs can usually do this for you, or you can useserialver
which ships with the JVM)In
SpringSecurityCoreVersionSerializableTests
, add the class and an example construction to thegeneratorByClassName
mapRun
SpringSecurityCoreVersionSerializableTests#serializeCurrentVersionClasses
.If successful, it will create a
{className}.serialized
file inconfig/src/main/resources/serialized
:Run the other tests in
SpringSecurityCoreVersionSerializableTests
; because it's new, the class will not be added to the list inshouldBeAbleToDeserializeClassFromPreviousVersion
; however, the class should no longer be in the output forlistClassesMissingSerialVersion
Commit the
Serialiizable
class(es) andSpringSecurityCoreVersionSerializableTests
If unsuccessful, it is usually because one of its members is not serializable. Find the unserializable member; file a ticket to ensure that it is made
Serializable
Here are the classes:
org.springframework.security.cas.jackson2.CasJackson2Moduleorg.springframework.security.saml2.jackson2.Saml2Jackson2Moduleorg.springframework.security.web.access.expression.WebExpressionConfigAttributeYou can also see the list of
Serializable
files by running:./gradlew :spring-security-config:test --tests "*MissingSerialVersion*" -Pserialization
The text was updated successfully, but these errors were encountered: