-
Notifications
You must be signed in to change notification settings - Fork 812
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-5407 Extend SecurityMemberAccess proxy detection to other proxies #911
WW-5407 Extend SecurityMemberAccess proxy detection to other proxies #911
Conversation
<groupId>org.hibernate</groupId> | ||
<artifactId>hibernate-core</artifactId> | ||
<version>6.4.4.Final</version> | ||
<optional>true</optional> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
core/pom.xml
Outdated
<dependency> | ||
<groupId>org.hibernate</groupId> | ||
<artifactId>hibernate-core</artifactId> | ||
<version>6.4.4.Final</version> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As far I know this version won't work on JDK8 which is a base version for Struts 6.x
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are correct - downgraded to Hibernate 5 as this proxy detection code is identical :)
b3578e2
to
0074b70
Compare
@jefferyxhy is a colleague of mine at Atlassian who is helping implement some security enhancements. |
if (hasMember(clazz, member)) | ||
return true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't be inlined?
return hasMember(clazz, member);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lukaszlenart updated. Thanks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great 👏 LGTM 👍
WW-5407
Reason
Currently
SecurityMemberAccess#isAccessible
return true for a method of a proxy object, which expose the beans at risk of being changed. We need to have the ability to detect proxy object and reject the access if required.See Jira card above for more details.
Changes/ Solution
currently in
isAccessible -> checkProxyMemberAccess
, it usedisallowProxyMemberAccess && ProxyUtil.isProxyMember(member, target)
which is not enough, asisProxyMember
only matches the member directly from proxy class, and does not match those ones original from the target class.So we update the
isAccessible
:checkProxyAccess
beforecheckProxyMemberAccess
which is controlled by:struts.disallowProxyObjectAccess
: an new struts constant to enable or disable this checking (default asfalse
)Result & Impact
struts.disallowProxyObjectAccess
asdefault
, no difference.struts.disallowProxyObjectAccess
astrue
, access to any member of a proxy object will be rejected, including both proxy member and original member of class. Which means whenever chained parametera.b.c.d.x
has one part that is a proxy, we reject the set to the lastx