Skip to content

Workflow ID prefix query condition is not properly escaped #535

@nate-getea

Description

@nate-getea

The startswith condition added to the get workflows query when a workflow_id_prefix is set does not escape underscores (_) in the provided ID prefix. This leads to dangerously unexpected behaviour (e.g. workflow_id_prefix='user:1_' matching a workflow with ID user:12_34232).

query = query.where(

The correct way to build a startswith query with an unsanitised input is:

query = query.where(
      SystemSchema.workflow_status.c.workflow_uuid.startswith(
          input.workflow_id_prefix, autoescape=True
      )
  )

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions