# Is there a configuration to reduce or hide sensitive fields in ThemeDisplay when rendering to client?

**URL:** <https://discuss.liferay.com/t/is-there-a-configuration-to-reduce-or-hide-sensitive-fields-in-themedisplay-when-rendering-to-client/109>\
**Category:** Security\
**Created:** [October 8, 2025, 3:16am UTC](https://discuss.liferay.com/t/is-there-a-configuration-to-reduce-or-hide-sensitive-fields-in-themedisplay-when-rendering-to-client/109 "2025-10-08T03:16:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![nhathm](https://dub1.discourse-cdn.com/flex014/user_avatar/discuss.liferay.com/nhathm/32/52_2.png) [@nhathm](https://discuss.liferay.com/u/nhathm)\
**Post date:** [October 8, 2025, 3:16am UTC](https://discuss.liferay.com/t/is-there-a-configuration-to-reduce-or-hide-sensitive-fields-in-themedisplay-when-rendering-to-client/109/1 "2025-10-08T03:16:59Z")

</div>

Hello Liferay community,

I am working on a Liferay portal (e.g. version 7.4) and have observed that, when a page is rendered, the `ThemeDisplay` (or `Liferay.ThemeDisplay` in JS) includes many fields such as `remoteAddr`, `userId`, `companyId`, `scopeGroupId`, etc. Exposing some of these can impose security risks (e.g. information disclosure, enumeration, reconnaissance).

My goal is to **limit or remove the more sensitive fields** (for example, `remoteAddr`, `realUserId`, `getUserId`,`getSiteAdminURL`) while still preserving fields that client extensions, JavaScript, or fragments might depend on (such as `getCompanyId()`, `getScopeGroupId()`, `portalURL`, `languageId`, etc.).

My questions:

1. Are there **built-in configurations** (portal-properties, module settings, theme config, etc.) in Liferay that allow hiding or filtering certain fields in `ThemeDisplay` when rendering to HTML / JavaScript?

2. If there is no built-in option, has anyone implemented examples or patterns (override JSP / FreeMarker / hook / servlet filter) to sanitize or strip sensitive fields from `ThemeDisplay`? If so, could you share sample code or approaches?

3. Would such modifications break or interfere with client extensions, fragments, or Liferay’s JS APIs? What pitfalls should one watch out for?

Thank you in advance for any insights or experience you can share!

 ![Picture1](https://europe1.discourse-cdn.com/flex014/uploads/liferay/original/1X/fb4d924c0a9413e26b5faf0e082a62d2df26de5d.png)

---

<div class="post-metadata">

**Author:** ![olafk](https://dub1.discourse-cdn.com/flex014/user_avatar/discuss.liferay.com/olafk/32/21_2.png) [@olafk](https://discuss.liferay.com/u/olafk)\
**Post date:** [October 8, 2025, 10:46am UTC](https://discuss.liferay.com/t/is-there-a-configuration-to-reduce-or-hide-sensitive-fields-in-themedisplay-when-rendering-to-client/109/2 "2025-10-08T10:46:46Z")

</div>

The examples that you name aren’t really that secret, or even problematic:

`remoteAddr`: revealing _a user’s_ IP address _to that same user_ is nothing to keep secret from them. They likely already know their own IP address. Or if they’re connecting through a proxy, that’s also on their end.

`realUserId`, `getUserId`: again, this is the id _of the accessing user_. It might also be contained as key in their account settings etc.

`getSiteAdminURL`: This is more or less a Liferay-specific URL. So if you can’t get it from ThemeDisplay, you can get it from any other Liferay instance, so you’d not be hiding any information that is truly secret.
