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

Security Manager Fixes #8

Merged
merged 2 commits into from Aug 3, 2021
Merged

Security Manager Fixes #8

merged 2 commits into from Aug 3, 2021

Conversation

jamezp
Copy link
Member

@jamezp jamezp commented Aug 3, 2021

The first commit reverts jboss/jboss-jaxrs-api_spec@b578e70, see https://issues.redhat.com/browse/JBEE-185

The second commit adds some new privileged actions https://issues.redhat.com/browse/JBEE-253.

…or container resolution of RESTEasy JAX-RS API impl"

This reverts commit dc89191.
…ix to ignore the privileged action if the security manager is not present.

https://issues.redhat.com/browse/JBEE-253
@jamezp jamezp merged commit 724f17c into jboss:2.1 Aug 3, 2021
@jamezp jamezp deleted the sm-fixes branch August 3, 2021 15:52
@jamezp jamezp mentioned this pull request Aug 3, 2021
Comment on lines +82 to +84
errorMessage = "ClassCastException: attempting to cast"
+ delegate.getClass().getClassLoader().getResource(classnameAsResource)
+ " to " + targetTypeURL;
Copy link

Choose a reason for hiding this comment

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

These lines and lines 92-94 are duplicates. Can't this be consolidated into a single point of definition?

Copy link
Member Author

Choose a reason for hiding this comment

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

I thought about it. Really it's just the delegate.getClass().getClassLoader() that needs to be privileged, but there didn't seem to be a good way to break that up without two privileged blocks so I did it like this.

@rsearls
Copy link

rsearls commented Aug 4, 2021

These 3 classes have a lot of common code. Can the common code be refactored into a utiltiy class that all can use?

jaxrs-api/src/main/java/javax/ws/rs/ext/FactoryFinder.java
jaxrs-api/src/main/java/javax/ws/rs/client/FactoryFinder.java
jaxrs-api/src/main/java/javax/ws/rs/sse/FactoryFinder.java

@jamezp
Copy link
Member Author

jamezp commented Aug 4, 2021

I don't think there is since it uses privileged actions. If there was a single class then anyone could use it to load class with the permissions required. It could lead to security issues.

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.

None yet

3 participants