Skip to content

Security hardening: disallow ScriptBlock step handlers by default (RCE risk via StepRegistry) #23

Closed as duplicate

Description

@blindzero

Finding

Step handlers can be ScriptBlocks that are executed by the engine. The step registry may be supplied via Providers.StepRegistry without explicit trust validation. If an untrusted source can influence the registry, this becomes an RCE vector.

Goal

Make the engine safe by default:

  • Step handlers MUST NOT be ScriptBlocks unless explicitly allowed (dev/test scenario).

Proposed approach

  • Update step handler resolution logic to accept only:
    • string (function name / command name)
    • optionally CommandInfo (if desired)
  • Reject ScriptBlock handlers unless an explicit trust policy/flag allows it, e.g.:
    • ExecutionContext.Policy.AllowScriptBlockHandlers = $true
    • or Invoke-IdlePlan -AllowScriptBlockHandlers (exact API tbd)

Acceptance criteria

  • Default behavior: ScriptBlock handlers are rejected with a clear error message.
  • Opt-in behavior: ScriptBlock handlers can be enabled explicitly for demo/test scenarios.
  • Pester tests cover:
    • default reject
    • opt-in accept
    • error message includes which step/handler was rejected

Documentation

  • Document the trust boundary: Providers.StepRegistry is host-provided and must be trusted.

Activity

  1. added
    new
    on Dec 30, 2025
  2. removed
    new
    on Dec 30, 2025
  3. added
    duplicate
    on Dec 30, 2025
  4. blindzero commented on Dec 30, 2025

    @blindzero
    OwnerAuthor

    Duplicates #17

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

Metadata

Metadata

Assignees

Labels

breaking-changeduplicatetype:coretype:securitytype:steps

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions