Skip to content

EXECUTE SCRIPT: no recursion depth limit (infinite loop) #472

@retran

Description

@retran

Description

A script that calls EXECUTE SCRIPT on itself runs infinitely with no depth protection. In 5 seconds it produces 206K+ lines of output before being killed.

Steps to Reproduce

echo "EXECUTE SCRIPT '/tmp/recursive.mdl';" > /tmp/recursive.mdl
echo "EXECUTE SCRIPT '/tmp/recursive.mdl'" | mxcli -p project.mpr
# Runs forever: "Executing script: /tmp/recursive.mdl" repeated infinitely

Expected

Error after a reasonable recursion depth (e.g., 16 or 32 levels): "maximum script nesting depth exceeded".

Suggested Fix

Track script depth in ExecContext or pass a depth counter through executeScript. Reject when depth exceeds a threshold.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions