Skip to content

Pod names/labels from team & app_slug are not DNS-1123 sanitized (pod creation 422s) #84

Description

@dev-dull

Summary

Pod names and labels are built by interpolating user_id, team, and app_slug without normalizing them to DNS-1123 (lowercase alphanumeric + -, ≤63 chars):

  • landing/app/pods.py:166name = f"build-{user_id}-{short}"; label sus.dev/user: user_id (line 73)
  • landing/app/run_pods.py:134name = f"run-{team}-{app_slug}-{short}"

team and app_slug flow from URL path segments in the build/run routes, which accept arbitrary values. Uppercase letters, underscores, or over-long values make create_namespaced_pod fail with a 422, breaking the build/run flow. (New apps generate safe slugs in main.py:155-156, but the routes don't re-validate incoming path segments.)

Suggested fix

Normalize/validate team, app_slug, and user_id to DNS-1123 before using them in pod names and labels — lowercase, replace invalid chars with -, collapse/trim, and truncate — or reject invalid path segments at the route with a clear 400.

Found during a repo audit.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions