PyPI / mako / 1.4.3

mako 1.4.3

Source
https://github.com/sqlalchemy/mako
Artifact scanned
mako-1.4.3-py3-none-any.whl (wheel · 78.3 KB · SHA-256 723296007c87…)
Compared with
mako-1.4.2-py3-none-any.whl (0 signals introduced since)
Files
35 scanned, 4 skipped (binary, oversized, or unrecognised)
Signals
0 critical · 0 warn · 13 info
Scan time
9.6 s
LLM review
Reviewed by claude-haiku-5-5 (Anthropic): 13 of 13 warn and critical signals; 13 demoted to info.
Disclude version
4.3.0
Scanned (UTC)
2026-10-23 06:58

Signals

Ordered by severity, then signals introduced in this release. Hidden characters are shown as ⟨U+…⟩.

  1. info warn → info by review dynamic-execution mako/_ast_util.py:89:12

    `compile` called on a non-literal expression (ast pass, confidence 0.70)

        """Parse an expression into an AST node."""
        return compile(expr, filename, mode, PyCF_ONLY_AST)
    likely benign LLM, confidence 0.90 Expression parser wrapper that calls compile with PyCF_ONLY_AST to build an AST node.
    Reasoning

    This is a helper that parses an expression string into an AST via compile with PyCF_ONLY_AST. The flag means it only builds a syntax tree and never executes code. Mako uses it to parse template expressions, so the non-literal argument is expected.

  2. info warn → info by review dynamic-execution mako/codegen.py:115:24

    `eval` called on a non-literal expression (ast pass, confidence 0.70)

                filtered = len(node.filter_args.args) > 0
                buffered = eval(node.attributes.get("buffered", "False"))
                cached = eval(node.attributes.get("cached", "False"))
                defs = None
    likely benign LLM, confidence 0.80 Evaluates a template tag attribute string (buffered flag) during code generation.
    Reasoning

    Mako's code generator calls eval on attribute strings from template tags such as buffered and cached. These are developer-written template directives compiled at template build time, not attacker-controlled runtime input. Eval is a poor design choice, but it is a legitimate template-engine pattern.

  3. info warn → info by review dynamic-execution mako/codegen.py:116:22

    `eval` called on a non-literal expression (ast pass, confidence 0.70)

                buffered = eval(node.attributes.get("buffered", "False"))
                cached = eval(node.attributes.get("cached", "False"))
                defs = None
                pagetag = None
    likely benign LLM, confidence 0.80 Evaluates the cached attribute of a template tag during code generation.
    Reasoning

    Same pattern as the neighbouring findings: eval of the cached attribute from a template tag during code generation. It comes from template source authored by the developer, so it is not an obfuscated payload.

  4. info warn → info by review dynamic-execution mako/codegen.py:129:26

    `eval` called on a non-literal expression (ast pass, confidence 0.70)

                        args += ["**pageargs"]
                    cached = eval(pagetag.attributes.get("cached", "False"))
                    self.compiler.enable_loop = self.compiler.enable_loop or eval(
                        pagetag.attributes.get("enable_loop", "False")
    likely benign LLM, confidence 0.80 Evaluates a page tag's cached attribute during code generation.
    Reasoning

    Evaluates the cached attribute of a page tag while generating code. This is the template compiler reading developer-written directive values, consistent with Mako's design.

  5. info warn → info by review dynamic-execution mako/codegen.py:130:74

    `eval` called on a non-literal expression (ast pass, confidence 0.70)

                    cached = eval(pagetag.attributes.get("cached", "False"))
                    self.compiler.enable_loop = self.compiler.enable_loop or eval(
                        pagetag.attributes.get("enable_loop", "False")
                    )
    likely benign LLM, confidence 0.80 Evaluates a page tag's enable_loop attribute during code generation.
    Reasoning

    Evaluates the enable_loop attribute of a page tag during code generation. The value comes from template source, so this is the compiler handling its own directives rather than an attacker-controlled execution path.

  6. info warn → info by review dynamic-execution mako/codegen.py:439:16

    `eval` called on a non-literal expression (ast pass, confidence 0.70)

                    )
                if eval(node.attributes.get("inheritable", "False")):
                    self.printer.writeline("context['self'].%s = ns" % (node.name))
    likely benign LLM, confidence 0.80 Evaluates a def tag's inheritable attribute during code generation.
    Reasoning

    Evaluates the inheritable attribute of a def tag during code generation. This is developer-authored template configuration processed by the compiler, which matches Mako's normal behaviour.

  7. info warn → info by review dynamic-execution mako/codegen.py:609:20

    `eval` called on a non-literal expression (ast pass, confidence 0.70)

            filtered = len(node.filter_args.args) > 0
            buffered = eval(node.attributes.get("buffered", "False"))
            cached = eval(node.attributes.get("cached", "False"))
            self.printer.writelines(
    likely benign LLM, confidence 0.80 Evaluates the buffered attribute of a template tag during code generation.
    Reasoning

    Evaluates the buffered attribute of a template tag during code generation. The input is developer template source, consistent with Mako's compiler design.

  8. info warn → info by review dynamic-execution mako/codegen.py:610:18

    `eval` called on a non-literal expression (ast pass, confidence 0.70)

            buffered = eval(node.attributes.get("buffered", "False"))
            cached = eval(node.attributes.get("cached", "False"))
            self.printer.writelines(
                # push new frame, assign current frame to __M_caller
    likely benign LLM, confidence 0.80 Evaluates the cached attribute of a template tag during code generation.
    Reasoning

    Evaluates the cached attribute of a template tag during code generation. This is the same benign template-directive handling as the other eval findings in this file.

  9. info warn → info by review dynamic-execution mako/codegen.py:723:41

    `eval` called on a non-literal expression (ast pass, confidence 0.70)

            if "timeout" in cache_args:
                cache_args["timeout"] = int(eval(cache_args["timeout"]))
    
            self.printer.writeline("def %s(%s):" % (name, ",".join(args)))
    likely benign LLM, confidence 0.75 Evaluates a cache timeout argument from a template tag and converts it to int.
    Reasoning

    Evaluates a cache timeout argument from the template, then casts it to int. The input is template source, so this is an unsafe-looking but ordinary template-compiler construct, not a hidden payload.

  10. info critical → info by review dynamic-import mako/runtime.py:662:15

    `__import__` called on a non-literal expression (ast pass, confidence 0.70)

    
            mod = __import__(module)
            for token in module.split(".")[1:]:
                mod = getattr(mod, token)
    likely benign LLM, confidence 0.80 Resolves a dotted module name to an object for template runtime lookup via __import__.
    Reasoning

    This loads a module by dotted name with __import__ and then walks attributes to reach the target. That is the standard way to resolve a template's module path, and the input comes from the developer's configuration, not from untrusted input. The critical severity reflects the signal, not the code's behaviour.

  11. info warn → info by review dynamic-execution mako/template.py:825:16

    `compile` called on a non-literal expression (ast pass, confidence 0.70)

        ):
            code = compile(source, cid, "exec")
    
            # the module body, which is the code of any <%! %> blocks, is
    likely benign LLM, confidence 0.85 Compiles generated template source into a code object.
    Reasoning

    Compiles Mako-generated Python source for a template into a code object. This is the core purpose of the template engine, and the source is produced from template files the developer supplies.

  12. info warn → info by review dynamic-execution mako/template.py:832:9

    `exec` called on a non-literal expression (ast pass, confidence 0.70)

            # the module as one step
            exec(code, module.__dict__, module.__dict__)
    
        return (source, module)
    likely benign LLM, confidence 0.85 Executes compiled template code to populate the template module namespace.
    Reasoning

    Executes the compiled template module code into the module's dict. This is the intended mechanism for loading a template, and it is the expected behaviour of a template engine. It is not a malicious dropper.

  13. info critical → info by review dynamic-import mako/util.py:45:19

    `__import__` called on a non-literal expression (ast pass, confidence 0.70)

            def load():
                mod = __import__(modulepath)
                for token in modulepath.split(".")[1:]:
                    mod = getattr(mod, token)
    likely benign LLM, confidence 0.80 Lazy loader that imports a module by path and resolves an attribute chain.
    Reasoning

    Imports a module by path string and walks its attributes to return the target object. This is a standard lazy-loading helper for resolving named objects in Mako, and the modulepath is supplied by the developer's code.

Reproduce This Scan

Run disclude locally to verify. These commands scan the published file; the "new in this release" marks come from comparing it with the previous release's file, which they don't repeat. Add --format sarif for SARIF output. Add --llm (with an API key in the environment) to include the LLM review.

cargo install disclude --version 4.3.0
curl -fsSL -o mako-1.4.3-py3-none-any.whl https://files.pythonhosted.org/packages/6d/a0/053d6af3e8f871e0073b4a36732d9e65be77a72e5434c31b94f6af78a6bb/mako-1.4.3-py3-none-any.whl
printf '%s  %s\n' 723296007c870bfd6b3f0c3230dba7198096e5269297ebf5e4eff9e7ffa39d4f mako-1.4.3-py3-none-any.whl | shasum -a 256 -c -
unzip -q mako-1.4.3-py3-none-any.whl -d pkg
disclude scan --untrusted --severity info pkg