-
Notifications
You must be signed in to change notification settings - Fork 825
WW-4805 Blocks ognl access to class members of Spring proxy #142
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
Conversation
What about performance? |
I think it's not a problem. It's complexity is O(1) when target is not a Spring proxy and O(n) where n is MAX(number of declared methods/fields, inheritances, interfaces or inner proxies) which are usually small. |
However, in my next commit, I try to check if |
But Also it would be nice to have some property which allows to access proxy members. |
So what do you recommend? Adding a cache? or something else you think about.
It's not hard to have but I could not think about any use case of accessing/modifying proxy members by USER. Have you any specific use case in your mind? If no, I think we can postpone this until users demand. |
*I forgot to emphasis that after my third commit, |
The case with those changes is that they will affect everyone even if you don't use Spring so its scope should be narrowed just to the Spring Plugin. The simplest solution is to add a flag, a constant that by default should turn off this check, but the Spring Plugin should have this flag set on to enable additional scanning. The ultimate solution would be a voter mechanism injectable by the internal DI mechanism but this requires a bit more work. |
@lukaszlenart Sounds good. Still, it would be nice to allow to turn this checking completely off even when spring plugin is presented. The issue then can be avoided with addition of a simple pattern which should be faster. |
With the flag in place you can always disable it in your {{struts.xml}} event it the Spring Plugin is present. |
Thank you @lukaszlenart , I got your point but what about when user uses Spring but not S2's Spring Plugin? i.e. when user does not want to define his/her actions as Spring beans but wants to use AOP on them. However, now, after my forth commit, I don't think we should be worry. I tested WW-4805's scenario heavily with hundreds concurrent users via JMeter while profiling via YourKit. All of |
Yeah I understand but still this affects non-Spring users. And I think this can go in as is and we can improve and think about the Voters mechanism in 2.6. |
If no objections I am going to merge this PR, btw. I have created a task to implement Voters |
IMO this can be merged |
@yasserzamani do you want to port some of those changes to 2.3.33? Or at least implement what @aleksandr-m mentioned in a comment? |
@lukaszlenart , Yes with pleasure. I should come with a new PR but on branch support-2-3, right? |
Yes, you must branch off from the |
I'll create a PR implementing this in a few days. |
Fixes what I sent to [email protected] (3/15/2017)