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
- 85 scanned, 38 skipped (binary, oversized, or unrecognised)
- Signals
- 1 critical · 0 warn · 22 info
- Scan time
- 15.9 s
- LLM review
- Reviewed by claude-haiku-5-5 (Anthropic): 23 of 23 warn and critical signals; 22 demoted to info.
- Disclude version
- 4.0.0
- Scanned (UTC)
- 2026-10-14 18:40
Signals
Ordered by severity, then signals introduced in this release. Hidden characters are shown as ⟨U+…⟩.
-
=inconclusive Module-level exec generating a test class from a formatted template string.Reasoning
Module-scope exec in a test file builds a class from a template string with %s formatting; it runs on import of the test module, which is unusual and worth a glance, but the content appears to be a generated test class with no network or shell activity visible.
-
"""Parse an expression into an AST node.""" returnlikely benign Helper that parses a template expression string into an AST node via compile().Reasoning
compile() with PyCF_ONLY_AST is the standard way to parse a Python expression into an AST in a template engine. The expression comes from template source the developer controls, so this is expected behavior, not obfuscation.
-
= > 0 = = = Nonelikely benign Evaluates the buffered attribute of a template def/block tag during code generation.Reasoning
Mako's code generator evaluates tag attributes such as buffered and cached, which are simple boolean literals written in the template. Templates are already trusted code in this library, so the eval is a known design choice rather than malicious intent.
-
= = = None = Nonelikely benign Evaluates the cached attribute of a template tag during code generation.Reasoning
Same pattern as the neighboring eval calls: a template tag attribute with a default of "False" is evaluated during code generation. This is an expected template-engine mechanism.
-
+= = = orlikely benign Evaluates the cached attribute of a page tag during code generation.Reasoning
Evaluates the cached attribute of a page tag to set code-generation flags. Consistent with Mako's attribute handling; the input is template-author supplied.
-
= = orlikely benign Evaluates the enable_loop attribute of a page tag during code generation.Reasoning
Evaluates the enable_loop attribute of a page tag, a boolean literal supplied in the template. This is ordinary template-compiler behavior.
-
)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. The value is a template-supplied boolean literal, so this is expected behavior in a template compiler.
-
= > 0 = =likely benign Evaluates the buffered attribute of a template tag during code generation.Reasoning
Evaluates the buffered attribute of a template tag during code generation, the same pattern as other tag-attribute evals in this file.
-
= =likely benign Evaluates the cached attribute of a template tag during code generation.Reasoning
Evaluates the cached attribute of a template tag during code generation, consistent with the rest of the compiler's attribute handling.
-
=likely benign Evaluates the cache timeout argument during code generation before converting it to int.Reasoning
Evaluates a cache timeout attribute and wraps it in int(). The input comes from template cache arguments, so this is a legitimate, if loose, template-compiler design choice. The eval is a minor trust-boundary concern only if templates are untrusted.
-
= =likely benign Dynamically imports a module by name to resolve a template namespace.Reasoning
__import__ resolves a module name taken from template namespace/import declarations, which is how Mako loads template namespaces. The module is chosen by the template author, so this is expected. The critical severity reflects the dynamic import, not a sign of malicious payload here.
-
): = # the module body, which is the code of any <%! %> blocks, islikely benign Compiles generated template module source into a code object.Reasoning
Compiling template source to a code object is the core function of Mako, which turns templates into Python modules. The source is the template being rendered, so this is the intended design, not a supply-chain payload.
-
# the module as one step returnlikely benign Executes the compiled template module code to populate the module namespace.Reasoning
exec runs the compiled template module into its namespace, which is the purpose of a template engine. The code is generated from the template, and the flag reflects the expected dynamic execution in this library.
-
= =likely benign Dynamic module import via __import__ in a helper that resolves a dotted module path.Reasoning
__import__ on a module path inside a load() helper is the standard lazy-import idiom used by Mako to load template-referenced modules; the path comes from configuration, not untrusted input in this snippet.
-
= =likely benign eval of test expressions to check AST round-tripping in a unit test.Reasoning
eval inside a test comparing original and regenerated Python expressions over fixed test code; this is a test harness pattern, not an attack.
-
= =likely benign Second eval in the same round-trip equality assertion within a unit test.Reasoning
Same test assertion comparing evaluated results of original and generated code; benign test harness.
-
= =likely benign eval used in an AST expression-equivalence test.Reasoning
Repeated round-trip evaluation assertion in test code with fixed local_dict fixtures; benign.
-
= =likely benign Second eval in the AST equivalence test assertion.Reasoning
Same benign test assertion comparing evaluation results with a fixed fixture dictionary.
-
=likely benign eval over a list of test code strings in an AST round-trip test.Reasoning
Loop over fixed code samples evaluated for equality in a test; no untrusted input.
-
=likely benign Second eval in the looped AST round-trip test.Reasoning
Same benign loop evaluation in test code.
-
likely benign eval within a conditional branch of an AST equivalence test.
Reasoning
Test assertion evaluating fixed test code strings; benign test harness.
-
likely benign Second eval in the conditional AST equivalence test.
Reasoning
Second benign eval in the same test assertion.
-
returnlikely benign compile call testing whether generated source raises SyntaxError.Reasoning
compile is used to check whether a template model is valid Python, catching SyntaxError; this is syntax validation in exception-handling tests, not execution.
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.
&&