-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Allow serialise/deserialise only specific classes - whitelisting #1866
Comments
I suspect that a simple "provide a white-list of all classes" approach is impractical for most users: there are plenty of types already in JDK. But perhaps ability to specify a class/class-name validator (serialization / deserialization) validation, similar to: would make sense? EDIT: implemented as #2195, included in 2.10.0. |
I think any of these will work, giving users an ability to control if a given class can be serialised/deserialised allows to build a whitelist anyway :) |
True. And one more thought I had: if the check is only made when a new "POJO" (de)serializer is needed, it would not even apply to "standard" types, for which (de)serializer is already found. So whatever validator was used could perhaps have couple of different methods, called at different points. Maybe some of these:
For security purposes, (4) probably really covers most if not all cases. And then user would only need to whitelist actual POJOs, and even those could be annotation based (i.e. user or 3rd party lib/framework defines tag annotation(s) to use, validator can look for that). |
nice 💯 |
@cowtowncoder If I understand correctly this issue (implementing whitelisting) is targeted only to 3.x, and the implementation of the whitelist depends on #2195. I have two questions:
|
Implementation of #2195 is targeted for 2.10; I originally was thinking 3.x but I think it can't really wait that far. I appreciate your offer to help, but unfortunately limit I have is time, not idea of how to implement this. So I don't think this is something that I can effectively parallelize until I get something working. |
@lukaszlenart @artem-smotrakov just a quick note: finally implemented most of #2195 so looking for feedback soon. I am reasonably content at design but hoping others to poke holes in it. |
Nice, thanks a lot @cowtowncoder :) Is this already included in a released version? |
@lukaszlenart No, it's still work-in-progress. It will be in 2.10.0; being API addition won't be backported. |
Great! |
Is there any ETA on this? It looks like there is going to be a continuous stream of CVEs to blacklist classes. The codehaus jackson added a whitelist which protects against any new classes from needing to be blacklisted and also lets the applications know and allow the classes to be deserialized. |
@bmaxwell This was implemented via #2195 included in 2.10.0 (which was released 1 week ago) so closing this as dup. Overview of new features, including this one at https://medium.com/@cowtowncoder/jackson-2-10-features-cd880674d8a2 but I hope to find time to blog about Safe Default Typing feature in bit more detail. |
As discussed in #1296 it would be good to allow define a whitelist with allowed classes that can be serialised/deserialised. This gives more control to the users and allows avoid any possible RCE attacks.
The text was updated successfully, but these errors were encountered: