Skip to content

Canvas Extensions: manifest model, validation, and entrypoint containment #4348

Closed

Description

@VascoSch92

Pydantic manifest model (schema_version, name, display_name, version, description, entrypoint, contributes.pages[]); name/contribution-ID/page-path validation; entrypoint containment check rejecting path traversal and symlink escapes, with its own adversarial tests (security-critical, don't fold into generic validation work).

Implementation notes (verified against current software-agent-sdk source):

  • Reuse validate_extension_name() (openhands-sdk/openhands/sdk/extensions/installation/utils.py:8-15) for the name field — already enforces kebab-case (^[a-z0-9]+(-[a-z0-9]+)*$), the same rule Plugins/Skills use today for path-traversal-safe extension names.
  • plugins_router.py:41 defines PLUGIN_NAME_PATTERN = r"^[a-z0-9]+(?:-[a-z0-9]+)*$" as a FastAPI Path(pattern=...) guard on the {name} route parameter, on top of the SDK-level check — defense in depth at the routing layer. Mirror this for the canvas-extensions routes.
  • entrypoint containment is not covered by validate_extension_name — that only validates the extension's own name, not paths inside its manifest. Needs its own check: resolve entrypoint against the installed package root and reject anything that escapes it. Watch for symlinks specifically, since path resolution follows them.

Part of the Canvas Extensions backend build-out.

Metadata

Metadata

Assignees

No one assigned

    Labels

    canvas-extensionssecurity-related

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions