Skip to content

The video-import wire accepts unbounded strings #857

Description

@JArmandoAnaya

src/visionset/server/models.py bounds none of the strings a video import declares:

  • display_name (line 885) - becomes the source's name
  • batch_name (line 891) - becomes the committed batch's name
  • materializer (line 895) - stored inside the source's video JSON blob
  • codec (line 859) - min_length=1 only

normalize_name rejects blank and nothing else, so a multi-megabyte display_name is accepted and stored. No path traversal or filename injection is reachable - the locator is video-import:<uuid4>, Asset.uri derives from it, and nothing on this path builds a filesystem path from a client string - so this is size only.

It matches what register_image_source already does with its name, so the fix is probably one length bound applied consistently at the boundary rather than something specific to video.

Related, same boundary: the 32-part cap on POST /video-imports/{id}/frames is enforced in the handler, after the multipart parser has accepted and spooled the parts. The parser's own default allows far more, so an oversized request is written to temp files before it earns its 422. The files are cleaned up, so this is transient disk rather than a leak.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    apivisionset.server — REST API and OpenAPI contractbackendvisionset Python distribution — kernel, server, cli, mcp, formats

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions