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

Solve ReflectPermission issue in sandbox security policy model for repackaged CGLIB ReflectUtils #24420

Merged
merged 1 commit into from
Jan 24, 2020

Conversation

kalmeshcs
Copy link

@kalmeshcs kalmeshcs commented Jan 23, 2020

When the custom Security Policy is implemented within the Spring Boot applications to restrict permissions for the user defined plugin code, below mentioned exception will be thrown while building the beans from the plugin code. This change will solve this issue. Same approach is already followed in SimpleInstantiationStrategy, ConstructorResolver and even in ReflectUtils (for some other statements but not this)

Issue:

org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.boot.autoconfigure.batch.JpaBatchConfigurer]: Factory method 'batchConfigurer' threw exception; nested exception is java.security.AccessControlException: access denied ("java.lang.reflect.ReflectPermission" "suppressAccessChecks")

Refer the attachment for complete stack trace.
Exception_Stacktrace.txt

@pivotal-issuemaster
Copy link

@kalmeshcs Please sign the Contributor License Agreement!

Click here to manually synchronize the status of this Pull Request.

See the FAQ for frequently asked questions.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Jan 23, 2020
@pivotal-issuemaster
Copy link

@kalmeshcs Thank you for signing the Contributor License Agreement!

@jhoeller jhoeller self-assigned this Jan 23, 2020
@jhoeller jhoeller added in: core Issues in core modules (aop, beans, core, context, expression) type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Jan 23, 2020
@jhoeller jhoeller added this to the 5.2.4 milestone Jan 23, 2020
@sbrannen sbrannen changed the title Solve ReflectPermission Issue in Sandbox Security Policy Model Solve ReflectPermission issue in sandbox security policy model for repackaged CGLIB ReflectUtils Jan 24, 2020
@jhoeller jhoeller merged commit d085577 into spring-projects:master Jan 24, 2020
@jhoeller jhoeller added the for: backport-to-5.1.x Marks an issue as a candidate for backport to 5.1.x label Jan 28, 2020
@spring-projects-issues spring-projects-issues added status: backported An issue that has been backported to maintenance branches and removed for: backport-to-5.1.x Marks an issue as a candidate for backport to 5.1.x labels Jan 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core Issues in core modules (aop, beans, core, context, expression) status: backported An issue that has been backported to maintenance branches type: enhancement A general enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants