kusalk commented on code in PR #967:
URL: https://github.com/apache/struts/pull/967#discussion_r1668348985


##########
core/src/main/java/com/opensymphony/xwork2/ognl/SecurityMemberAccess.java:
##########
@@ -209,10 +209,23 @@ public boolean isAccessible(Map context, Object target, 
Member member, String pr
      * @return {@code true} if member access is allowed
      */
     protected boolean checkAllowlist(Object target, Member member) {
-        Class<?> memberClass = member.getDeclaringClass();
         if (!enforceAllowlistEnabled) {
             return true;
         }
+
+        if (!disallowProxyObjectAccess && target != null && 
ProxyUtil.isProxy(target)) {
+            // If `disallowProxyObjectAccess` is not set, allow resolving 
Hibernate entities to their underlying
+            // classes/members. This allows the allowlist capability to 
continue working and offer some level of
+            // protection in applications where the developer has accepted the 
risk of allowing OGNL access to Hibernate
+            // entities. This is preferred to having to disable the allowlist 
capability entirely.

Review Comment:
   Done



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to