diff --git a/core/src/main/java/com/opensymphony/xwork2/ognl/SecurityMemberAccess.java b/core/src/main/java/com/opensymphony/xwork2/ognl/SecurityMemberAccess.java index f225b3c89c..1d88df0993 100644 --- a/core/src/main/java/com/opensymphony/xwork2/ognl/SecurityMemberAccess.java +++ b/core/src/main/java/com/opensymphony/xwork2/ognl/SecurityMemberAccess.java @@ -224,7 +224,6 @@ public boolean isAccessible(Map context, Object target, Member member, String pr */ protected boolean checkAllowlist(Object target, Member member) { if (!enforceAllowlistEnabled) { - logAllowlistDisabled(); return true; } @@ -495,6 +494,9 @@ public void useExcludedPackageExemptClasses(String commaDelimitedClasses) { @Inject(value = StrutsConstants.STRUTS_ALLOWLIST_ENABLE, required = false) public void useEnforceAllowlistEnabled(String enforceAllowlistEnabled) { this.enforceAllowlistEnabled = BooleanUtils.toBoolean(enforceAllowlistEnabled); + if (!this.enforceAllowlistEnabled) { + logAllowlistDisabled(); + } } @Inject(value = STRUTS_ALLOWLIST_CLASSES, required = false)