CVE-2026-34444 Overview
CVE-2026-34444 is an authorization bypass vulnerability in Lupa, a Python library that integrates Lua or LuaJIT2 runtimes into CPython. In versions 2.6 and earlier, the attribute_filter security mechanism is not consistently applied when attributes are accessed through built-in functions like getattr and setattr. This inconsistency allows attackers to bypass intended attribute access restrictions and ultimately achieve arbitrary code execution within the affected application.
Critical Impact
Attackers can bypass Lupa's attribute_filter security mechanism to access restricted attributes and execute arbitrary code in applications using Lupa for Lua/Python interoperability.
Affected Products
- Lupa versions 2.6 and earlier
- Applications using Lupa for Lua/LuaJIT2 integration with CPython
- Python environments with Lupa dependencies
Discovery Timeline
- 2026-04-06 - CVE CVE-2026-34444 published to NVD
- 2026-04-07 - Last updated in NVD database
Technical Details for CVE-2026-34444
Vulnerability Analysis
The vulnerability resides in Lupa's attribute access control mechanism. Lupa provides an attribute_filter feature that allows developers to restrict which Python object attributes can be accessed from Lua code. This is a critical security boundary when embedding Lua scripting capabilities in Python applications, particularly when executing untrusted Lua scripts.
The root issue is that the attribute_filter validation is not consistently enforced across all attribute access pathways. While direct attribute access may be properly filtered, the built-in functions getattr and setattr bypass this security check. This creates a window for attackers to access attributes that should be protected, potentially leading to arbitrary code execution by accessing dangerous methods or modifying critical object state.
This vulnerability is classified under CWE-284 (Improper Access Control), reflecting the failure to properly enforce access restrictions on protected resources.
Root Cause
The root cause is an inconsistent implementation of the attribute_filter security control. When Lua code uses built-in Python functions like getattr() and setattr() to access or modify object attributes, Lupa fails to invoke the configured attribute filter. This creates two distinct code paths for attribute access: one that enforces the filter (direct attribute access) and one that bypasses it (built-in function access).
Attack Vector
The attack is network-accessible since applications using Lupa often process Lua scripts from external sources. An attacker can craft malicious Lua code that uses getattr or setattr to:
- Access restricted methods on Python objects exposed to Lua
- Modify protected attributes to alter application behavior
- Chain access to dangerous methods like __class__, __bases__, or __subclasses__ to traverse the Python object hierarchy
- Ultimately execute arbitrary Python code by reaching system-level functionality
The attack requires no authentication or user interaction when the vulnerable application accepts and executes Lua scripts from untrusted sources.
Detection Methods for CVE-2026-34444
Indicators of Compromise
- Unexpected Lua script execution patterns attempting to access getattr or setattr functions
- Application logs showing attribute access to protected or sensitive Python object attributes
- Anomalous process spawning or file system activity originating from Python processes running Lupa
- Evidence of Python object hierarchy traversal via __class__, __bases__, or __subclasses__ attributes
Detection Strategies
- Audit Lua scripts processed by the application for usage of getattr and setattr built-in functions
- Implement logging around attribute access operations in Lupa-integrated applications
- Monitor for suspicious Python object attribute access patterns that indicate filter bypass attempts
- Deploy runtime application self-protection (RASP) to detect code execution anomalies
Monitoring Recommendations
- Enable verbose logging for Lupa attribute access operations during security assessments
- Implement alerting on any Lua scripts attempting to access Python introspection attributes
- Monitor application behavior for signs of sandbox escape or unauthorized code execution
- Review application logs for error messages related to attribute access denials followed by successful access
How to Mitigate CVE-2026-34444
Immediate Actions Required
- Upgrade Lupa to the latest patched version that addresses the attribute filter bypass
- Audit all Lua scripts executed by your application for potential exploitation attempts
- Consider disabling Lua script execution from untrusted sources until patching is complete
- Review and restrict the Python objects exposed to Lua scripts to minimize attack surface
Patch Information
A security patch is available through the GitHub Security Advisory. Users should upgrade to the patched version of Lupa as soon as possible. Review the advisory for specific version information and upgrade instructions.
Workarounds
- Implement an additional validation layer that sanitizes Lua scripts before execution, blocking usage of getattr and setattr
- Restrict the Python objects exposed to Lua to only include explicitly safe objects with no dangerous methods accessible
- Run Lupa-based applications in isolated environments with minimal system privileges to limit the impact of code execution
- Consider using process-level sandboxing (containers, seccomp) to contain potential exploitation
For environments unable to immediately upgrade, implement strict input validation on all Lua scripts and consider temporarily disabling Lua script execution from external sources. Consult the GitHub Security Advisory for additional mitigation guidance.
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.


