Skip to content

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

Merged
jhoeller merged 1 commit into
spring-projects:masterfrom
kalmeshcs:solve-ReflectPermission
Jan 24, 2020
Merged

Solve ReflectPermission issue in sandbox security policy model for repackaged CGLIB ReflectUtils#24420
jhoeller merged 1 commit into
spring-projects:masterfrom
kalmeshcs:solve-ReflectPermission

Conversation

@kalmeshcs

@kalmeshcs kalmeshcs commented Jan 23, 2020

Copy link
Copy Markdown

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
Copy Markdown

@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
Copy Markdown

@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
@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 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.

4 participants