r/java • u/PartOfTheBotnet • Mar 21 '23
JDK 21: Disallowing the dynamic loading of agents by default
https://mail.openjdk.org/pipermail/serviceability-dev/2023-March/046868.html
60
Upvotes
r/java • u/PartOfTheBotnet • Mar 21 '23
View all comments
Show parent comment
2
u/FirstAd9893 Mar 21 '23 edited Mar 21 '23
The feature that's going to be disabled by default isn't attaching, it's dynamic agent loading. This is a feature to enhance the security of the module system.
The module system provides simpler (and therefore superior) security compared to the old security manager. There's a few tasks that need to be finished before modules can fully achieve this this goal, however.
A major issue is that file and network access are still in the base module. Assuming that was resolved (and a few other items), it becomes possible to implement things like client-provided code plugins. Imagine if a client could install something like a stored procedure in a database, which is written in Java and it runs in a security sandbox. Or imagine if an applet-like system was reinvented, it too would require some sort of security sandbox.
The whole system falls apart if the client-provided code is able to load an agent which could modify all the code in the system to do whatever it wants. The only other thing guarding against that today is the security manager, but that's deprecated.