Skip to content

⏱️ Bug: No Timeout Limit on Script/Command Execution #244

Description

@savniagrawal1701

⏱️ Bug: No Timeout Limit on Script/Command Execution

Current Behavior

The /api/scripts/run and /api/exec endpoints execute
scripts and commands with no timeout limit. If a script
contains an infinite loop, a hanging network call, or any
long-running operation, it will block the server indefinitely
with no way to cancel or recover from it.

Steps to Reproduce

  1. Create a script with an infinite loop e.g. while true; do echo "running"; done
  2. Run the script via /api/scripts/run
  3. The server hangs forever with no response or timeout

Expected Behavior

Scripts and commands should have a configurable timeout limit.
If execution exceeds the limit, the process should be killed
and a clear timeout error should be returned to the user.

Proposed Solution

Add a timeout parameter to run_script() and exec_command()
in app.py using subprocess timeout

Why This Matters

  • Prevents server from hanging on bad scripts
  • Protects against accidental or intentional DoS
  • Standard safety feature in all script execution platforms

Files to Modify

  • app.pyrun_script(), exec_command()

I am a GSSoC '26 contributor and would love to work on
this issue. Please assign it to me! 🙏

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions