mako 1.4.3
- Source
- https://github.com/sqlalchemy/mako
- Tag scanned
rel_1_4_3- Compared with
rel_1_4_2(0 signals introduced since)- Files
- 108 scanned, 15 skipped (binary, oversized, or unrecognised)
- Signals
- 0 critical · 0 warn · 24 info
- Scan time
- 16.1 s
- LLM review
- Reviewed by claude-haiku-5-5 (Anthropic): 23 of 23 warn and critical signals; 23 demoted to info.
- Disclude version
- 4.1.0
- Scanned (UTC)
- 2026-10-22 04:09
Signals
Ordered by severity, then signals introduced in this release. Hidden characters are shown as ⟨U+…⟩.
-
"""Parse an expression into an AST node.""" returnlikely benign Parses a template expression string into a Python AST node.Reasoning
compile with PyCF_ONLY_AST is the standard way to parse a Python expression into an AST node. The expression comes from the template being compiled, so this is the templating engine's normal parsing step, not obfuscation or a dropper.
-
= > 0 = = = Nonelikely benign Evaluates the 'buffered' attribute of a def or block tag to a Python value.Reasoning
eval is applied to a template tag attribute such as buffered="True" to turn it into a boolean. The input is the template author's own markup, and this is a known pattern in Mako's code generator. It is a code smell but not malicious.
-
= = = None = Nonelikely benign Evaluates the 'cached' attribute of a tag during code generation.Reasoning
Same pattern as the neighbouring eval calls: the attribute value comes from template source and is evaluated to a boolean during code generation. Nothing indicates attacker-controlled data reaching this at runtime.
-
+= = = orlikely benign Evaluates a page tag's 'cached' attribute during code generation.Reasoning
Evaluates the cached attribute of a page tag at compile time. This is template-author input processed by the compiler, consistent with the rest of the codegen module.
-
= = orlikely benign Evaluates a page tag's 'enable_loop' attribute during code generation.Reasoning
Evaluates the enable_loop attribute of a page tag at compile time. Template-author input only, consistent with the module's design.
-
)likely benign Evaluates the 'inheritable' attribute of a def tag during code generation.Reasoning
Evaluates the 'inheritable' attribute of a def tag to decide whether to emit a line of generated code. Input is template markup at compile time, so this is a benign compiler pattern.
-
= > 0 = =likely benign Evaluates the 'buffered' attribute of a block tag during code generation.Reasoning
Evaluates the buffered attribute of a tag during code generation. Template-author input, benign compiler behavior.
-
= =likely benign Evaluates the 'cached' attribute of a block tag during code generation.Reasoning
Evaluates the cached attribute of a block tag during code generation. Same benign template-compilation pattern.
-
=likely benign Evaluates a cache timeout expression from a template tag to an integer.Reasoning
Evaluates the cache timeout argument in template source to an int at compile time. Template-author input only, so this is a benign if unusual use of eval.
-
= =likely benign Dynamically imports a module by name in the Mako runtime to resolve a reference.Reasoning
__import__ loads a module named in the template's configuration or URI, followed by getattr traversal. This is how Mako's runtime resolves module references, and the critical severity reflects the signal type rather than a sign of malice. The residual doubt is that module names could come from untrusted input.
-
): = # the module body, which is the code of any <%! %> blocks, islikely benign Compiles generated template module source into a Python code object.Reasoning
compile turns the generated Python module source into a code object. Compiling templates to Python bytecode is Mako's core function, and the source is produced by the engine itself.
-
# the module as one step returnlikely benign Executes the compiled template module to load it.Reasoning
exec runs the compiled template module in its own namespace. This is the intended purpose of a template engine, which turns templates into executable modules. It is not a hidden payload.
-
= =likely benign Lazily imports a module from a dotted path via a load helper.Reasoning
__import__ loads a module from a modulepath string, then walks attributes to reach the target. This is a standard lazy-import helper for a library. The only risk is an untrusted modulepath, which is unlikely in this context.
-
A dialog pops up. Fill in all the fields you can on the Project Info tab, enter the path to your project on the Paths tab (ie -
= =dismissed Evaluates original and regenerated expression code in a unit test.Reasoning
This is a test asserting that a generated expression evaluates the same as the original. The eval runs on test fixtures, not on untrusted input.
-
= =dismissed Evaluates the regenerated expression in a unit test comparison.Reasoning
Same test assertion as the adjacent eval call. It compares two fixture expressions in a unit test, so it is not an attack surface.
-
= =likely benign eval of original and regenerated expression in an AST round-trip test.Reasoning
Test comparing evaluation of original and regenerated Python expression code with a local dict; eval on test-generated expressions in a test suite is a normal pattern for verifying a code generator.
-
= =likely benign eval of regenerated expression string in an AST round-trip test.Reasoning
Same test assertion evaluating the regenerated code string; benign test harness comparing outputs of parsed and generated expressions.
-
=likely benign eval in a parameterized AST round-trip test loop.Reasoning
Same round-trip test pattern over a list of literal test cases; eval is used to compare semantic equivalence, not to run untrusted input.
-
=likely benign eval of regenerated code in a test loop.Reasoning
Same benign test assertion evaluating regenerated code within a test loop.
-
likely benign eval comparing original and regenerated code in a test.
Reasoning
Repeated round-trip equivalence check in a test file; eval is a standard tool for comparing evaluation results in tests.
-
likely benign eval of regenerated code in a test comparison.
Reasoning
Same benign test comparison of evaluated regenerated code.
-
returnlikely benign compile call testing syntax validity of generated code in a test.Reasoning
compile is used to check whether generated model source has a syntax error inside a test, returning the model on SyntaxError; this is a test utility with no malicious effect.
-
=likely benign Module-level exec generating a class definition from a string template in a lexer test.Reasoning
Module-scope exec building a class from a template in a test file is a common metaprogramming pattern for generating test classes; critical severity is overstated given it is test code with a generated template, though exec at import time warrants a glance at the template source.
Reproduce This Scan
Run disclude locally to verify. Add --format sarif for SARIF output. Add --llm (with an API key in the environment) to include the LLM review.
&&