Skip to content

[BUG][HIGH] Batch schedule availability validation not in transaction with creation #673

Description

@kambiz-aghaiepour

Description

In the admin batch schedule endpoint (POST /api/v3/schedules/batch), host availability is validated outside any transaction, then schedules are created later. This is a TOCTOU vulnerability.

The single schedule creation path has the same TOCTOU issue but at least validates closer to the insert.

Affected Code

  • src/quads/server/blueprints/schedules.py:574-582 (validation loop)
  • src/quads/server/blueprints/schedules.py:631-639 (creation loop)

Recommended Fix

Perform both availability validation and schedule creation within a single database transaction using row-level locking (SELECT ... FOR UPDATE).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions