Skip to content

fix: Livechat Custom Fields displaying only visitor scope - #40325

Merged
dionisio-bot[bot] merged 2 commits into
developfrom
fix/livechat-custom-fields
Apr 29, 2026
Merged

dionisio-bot[bot] merged 2 commits into
developfrom
fix/livechat-custom-fields

test: update tests for useValidCustomFields to use dynamic mock data …

e629876
Select commit
Loading
Failed to load commit list.
RC - Layne / Layne Security Scan failed Apr 29, 2026 in 1m 18s

Layne — failure

Found 1 issue(s): 0 critical, 1 high, 0 medium, 0 low.

Blocking findings:

  • LAYNE-4613623453785c41 [pi_agent/pi_agent/prototype-pollution] apps/meteor/client/views/omnichannel/contactInfo/hooks/useValidCustomFields.ts:21

To approve, post a comment:
/layne exception-approve LAYNE-4613623453785c41 reason:

Annotations

Check failure on line 23 in apps/meteor/client/views/omnichannel/contactInfo/hooks/useValidCustomFields.ts

See this annotation in the file changed.

@rc-layne rc-layne / Layne Security Scan

[pi_agent] pi_agent/prototype-pollution

[R21-R23] Prototype pollution: The filter condition on line 24 checks `value` as a truthy boolean but doesn't check if `key` is an own property of `userCustomFields`. Object.entries() enumerates enumerable properties from the prototype chain in addition to own properties, so an attacker who can control the `userCustomFields` object can inject prototype properties like `__proto__`, `constructor`, or `prototype` as keys. When the filter condition `checkIsVisibleAndCorrectScope(key, data?.customFields, scope) && value` evaluates, these prototype keys will retrieve values from the Object prototype (like function references), which are truthy and can cause the prototype-related entries to be returned as valid custom fields. This can overwrite inherited properties across the process. Fix by adding a `.hasOwnProperty()` check before filtering, e.g., use Object.entries(userCustomFields).filter(([key, value]) => Object.prototype.hasOwnProperty.call(userCustomFields, key) && checkIsVisibleAndCorrectScope(key, data?.customFields, scope) && value).