Taipy Class Pollution Vulnerability Leading to RCE
Taipy v4.0.3 contains a class pollution vulnerability (CVE-2025-30374) that allows unauthenticated attackers to manipulate server-side state via crafted WebSocket messages, resulting in RCE, credential leakage, XSS, and DoS.
A severe class pollution vulnerability, identified as CVE-2025-30374, exists in Taipy v4.0.3. The vulnerability stems from an insecure recursive state update mechanism in taipy/gui/utils/_attributes.py, where client-provided input is used to dynamically update object attributes without validation. Attackers can leverage this to inject malicious attribute paths (analogous to prototype pollution), effectively overwriting internal application state, module attributes, or class methods at runtime.
The impact is significant, as attackers can achieve Remote Code Execution (RCE) by manipulating the Gui.__SELF_VAR attribute used within internal eval() calls. Furthermore, the vulnerability enables credential exfiltration, such as OpenAI API tokens, by redirecting outbound application traffic, as well as enabling Reflected XSS and Denial of Service (DoS) by crashing the application or injecting malicious content into rendered responses. This flaw represents a critical security risk for any Taipy deployment exposing application state management to client-side input.
Attack Chain
- Attacker establishes a WebSocket connection to the targeted Taipy application.
- Attacker crafts a malicious message payload containing an attribute path injection string (e.g.,
_TpN_tpec_TpExPr...). - The message is sent to the Taipy server, where it is processed by
_manage_message. - The
_setscopeattr_drillfunction is triggered, passing the attacker's input to the recursive_attrsetterfunction. - The
_attrsetterfunction usessetattrandgetattrto traverse and modify server-side object attributes based on the attacker's path. - Attacker targets specific internal attributes such as
Gui.__SELF_VARor method attributes on_TaipyBase. - Upon subsequent application logic execution, the modified attributes are accessed or evaluated (e.g., via
eval()). - Final objective achieved: RCE, credential exfiltration, XSS injection, or application crash.
Impact
The vulnerability affects Taipy v4.0.3 users. Successful exploitation allows for complete server compromise through RCE, theft of sensitive configuration secrets like OpenAI tokens, disruption of services via DoS, and potential account takeover via XSS. Given the availability of public proof-of-concept exploits, the risk to unpatched infrastructure is high.
Recommendation
Prioritize the following actions to detect and mitigate CVE-2025-30374:
- Update Taipy to a patched version immediately upon vendor release.
- Implement strict server-side validation for all input parameters received via WebSocket messages in
_manage_message. - Block or inspect WebSocket traffic containing deeply nested attribute paths or sequences targeting internal application classes.
- Audit infrastructure logs for unauthorized WebSocket messages containing
__class__,__base__, or__SELF_VARpatterns.
Immediate actions
Patch Taipy instances to latest secure version.
Threat Hunt
Search WebSocket logs for messages containing 'name' fields with '__class__' or '__base__' substrings.
Data: Application WebSocket logs
Enrichment needed
- CVE-2025-30374 patch availability (CTI) Ensure a fix is available from Avaiga before advising internal teams.
Mitigations
Restrict outbound internet access for servers running Taipy.
Credential leakage/Exfiltration
Indicators of compromise
1
url
| Type | Value |
|---|---|
| url | https://webhook.site/0df4ac02-0b20-4ffc-bbda-287da8bc8a0a |