Repository navigation
Isolate class-injection lookup module opening - #176
Merged
Merged
Conversation
Generate a narrow lookup helper in a dedicated class loader so opening 'java.lang.invoke' does not grant deep reflection to application code sharing the injector's module. Define the helper with the injector's protection domain. Verify module isolation, generated bytecode, and premain initialization under a SecurityManager with only the four required permission grants.
mcculls
marked this pull request as ready for review
November 25, 2026 16:31
mcculls
requested review from
amarziali and
jandro996
and removed request for
a team
November 25, 2026 16:31
amarziali
approved these changes
Nov 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What Does This Do
Define the lookup helper in a dedicated class loader with the injector's protection domain, and open
java.lang.invokeonly to that helper's module. The helper constructs the full-privilege lookup used to define the hidden class-injection glue.Motivation
Opening
java.lang.invoketo the injector's module also grants deep reflection to application code sharing that module. Isolating the helper confines the module opening while preserving the existing transformation fallback.Additional Notes
Tests cover module isolation, the helper's protection domain, generated bytecode verification and unpacking, and initialization during agent premain under a SecurityManager granting the four required permissions.
Java 24 permanently disabled SecurityManager, so that test is skipped for Java 24+
Contributor Checklist
Jira ticket: not provided.