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

WW-5341 Ensure exclusion list applies to objects from all ClassLoaders #741

Merged
merged 9 commits into from
Sep 26, 2023

Conversation

kusalk
Copy link
Member

@kusalk kusalk commented Aug 30, 2023

WW-5341

In applications where there are multiple classloaders, it may be possible for SecurityMemberAccess to obtain a false negative if the classloader used to load the target object was different to the one used to load the exclusion list.

To rectify this, we use String comparison of the class name instead. We still use the default classloader to validate the exclusion list on application start. A future enhancement might be to make the validating classloader configurable.

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

85.7% 85.7% Coverage
0.0% 0.0% Duplication

@@ -84,16 +86,17 @@ public Object setup(Map context, Object target, Member member, String propertyNa

@Override
public void restore(Map context, Object target, Member member, String propertyName, Object state) {
if (state != null) {
final AccessibleObject accessible = (AccessibleObject) member;
final boolean stateBoolean = ((Boolean) state).booleanValue(); // Using twice (avoid unboxing)
Copy link
Member Author

@kusalk kusalk Aug 30, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what this comment meant but don't think my refactor has broken anything

@kusalk kusalk marked this pull request as ready for review August 30, 2023 04:07
@kusalk kusalk requested a review from lukaszlenart September 6, 2023 01:50
Copy link
Member

@lukaszlenart lukaszlenart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@lukaszlenart lukaszlenart merged commit 501d395 into master Sep 26, 2023
@lukaszlenart lukaszlenart deleted the WW-5341-classloaders branch September 26, 2023 08:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants