Skip to content

Windows: URL-launch classifier mistakes -Stage Start argument for a command under never #55117

Open

Description

@cutthreat

Windows command-safety treats a PowerShell parameter value as a URL launcher

This report contains no session transcripts, runtime logs, screenshots, attachments, business URLs, account identifiers, credentials or local user paths.

Runtime and observed failure

Installed runtime: Codex CLI 0.162.0-alpha.17.2, Windows, approval policy never, approvals reviewer user, sandbox danger-full-access.

A metadata-only PowerShell helper was rejected before process creation with blocked by policy. Its -Stage parameter had the literal value Start, and a separate -TargetUrl parameter held an HTTPS URL. Browser navigation would have been a separate native tool operation after admission; the helper itself does not launch the URL.

The following is descriptive token data, not an instruction to execute a command:

["pwsh", "-File", "<metadata-only-helper.ps1>", "-Stage", "Start", "-TargetUrl", "https://example.invalid/catalog"]

Matching-version static finding

Static inspection of published tag rust-v0.162.0-alpha.17.2 shows that the Windows URL-launch predicate combines any HTTP(S) word with any launch-marker word. The argument value Start therefore matches this predicate.

This matches the observed refusal, but is not an internal trace of the running binary's matched rule. The exact compilation commit of the installed binary has not been separately established.

Requested supported resolution

Please review this suspected false positive and distinguish a PowerShell command invocation from an argument value without weakening detection of actual URL-launch commands. Keep real Start-Process, start, saps, Invoke-Item and ii URL launches under the intended policy. Paired regression cases should cover metadata-only argument values and actual URL-launch commands, including the never decision path.

Please provide a supported product fix or a documented review path for this specific built-in refusal. This is not a request to change the account's policy, add an allow rule, bypass safeguards or approve an unrelated action.

An exact-version experimental schema contains thread/approveGuardianDeniedAction, requiring a serialized GuardianAssessmentEvent. No genuine such event was provided for this never/user pre-exec refusal; that method was not invoked and no event was fabricated.

No rejected command or equivalent was retried. No rules, runtime policy, Desktop lifecycle, browser sessions or credentials were changed. No logs or sessions are attached to this report.

Activity

  1. added
    bug
    CLI
    windows-os
    sandbox
    on Oct 18, 2026
  2. clva01 commented on Nov 5, 2026

    @clva01

    Confirmed remaining Windows PowerShell parameter-value false positive after #54076

    Related merged partial fix: #54076

    Observed environment

    • Windows; native PowerShell 7.
    • Codex Desktop bundled executable reports codex-cli 0.166.0-alpha.6.
    • Effective chat permissions: disabled filesystem sandbox/full access, approval mode never.
    • User rule inventory: 65 allow rules, no prompt/forbidden rules.
    • No Guardian assessment/rejection event was found for the original refusal.
    • No settings, rule files, or installed binaries were changed.

    Minimal observed reproduction

    This function only writes a parameter to stdout. The URL is printed as text:
    there is no network call, process launch, service action, or filesystem mutation.

    function Test-LocalParameter { param([string]$Operation) Write-Output $Operation }
    Write-Output http://127.0.0.1:8890
    Test-LocalParameter -Operation Ready | Out-String

    Actual result: PowerShell executes successfully, exit code 0, prints the URL and Ready.

    Change only Ready to Start in the final line:

    Test-LocalParameter -Operation Start | Out-String

    Actual result: rejected before PowerShell process creation:
    CreateProcess ... rejected: blocked by policy

    Do not execute a URL launch or a lifecycle action to test this report.
    The paired observations above were obtained using stdout-only commands.

    Version-specific source evidence

    The contents of windows_dangerous_commands.rs were retrieved for:

    • rust-v0.166.0-alpha.6
    • latest stable rust-v0.166.0 (published 29Oct2026)
    • main inspected 05Nov2026

    All three retrieved files are byte-for-byte equal as text (24,811 characters).
    Thus the latest stable source does not contain a further fix for this case.
    This comparison is not a claim that an updated Desktop binary was installed or tested.

    Relevant source:
    https://github.com/openai/codex/blob/rust-v0.166.0-alpha.6/codex-rs/shell-command/src/command_safety/windows_dangerous_commands.rs
    https://github.com/openai/codex/blob/rust-v0.166.0-alpha.6/codex-rs/core/src/exec_policy.rs

    The literal-command fast path added by #54076 deliberately excludes pipelines
    and leaves unsupported script forms opaque. The opaque URL-launch predicate
    combines a URL with a Start-like word anywhere in the flattened words.
    The exec-policy fallback turns the resulting dangerous-command match into
    Forbidden under approval mode never.

    The controlled pair and matching-version source establish a reproducible
    false positive. The internal matched-rule trace was not exposed by the binary.

    Requested product correction

    Please correct the shared PowerShell command/argument analysis, rather than
    adding a project-specific allow rule, a localhost exception, or disabling the
    URL-launch/forced-delete safeguards.

    Keep actual command identity, literal argument identity, and executable-string/
    wrapper context in one structured parsed representation. A literal Start
    parameter or ordinary output text must not become evidence of a URL launch.
    Dynamic execution and genuine URL-launch or destructive actions must retain
    their appropriate policy decisions. Unsupported dynamic cases need an explicit,
    actionable diagnostic, not an unexplained aggregate blocked-by-policy result.

    Acceptance for a fix

    1. The two stdout-only cases above both execute under the same permissions.
    2. A read-only HTTP health probe followed by a registered local environment
      operation with literal -Operation Start is not classified as a GUI URL launch.
    3. Real Start-Process/Invoke-Item URL launches and their aliases remain detected.
    4. Variable-based URL launch, command rebinding, and executable-string pipelines
      remain covered by security regressions.
    5. Nested cmd /c start and Windows Terminal wrappers remain detected.
    6. Existing forced-delete cases retain their decisions.
    7. A native Windows integration test exercises the exec-policy consumer with
      the same regression inputs; classifier-only tests are insufficient.
    8. The normal application update carries the fix. No broad command-prefix
      exemption, custom runtime binary, or local security downgrade is required.

    No operational logs, application data, account identifiers, credentials,
    screenshots, or private worktree paths are included in this report.

  3. nyxmoon-oss commented on Nov 12, 2026

    @nyxmoon-oss

    I can confirm a single-command case on Windows Desktop with PowerShell 7.6.9. Bundled Codex versions 0.167.0-alpha.3.2 and 0.167.0-alpha.4.1 both rejected the same local application invocation before process creation under never and danger-full-access. It called a fixed, quoted path to Python. The application received a subcommand named start and an HTTPS source link inside a text argument.

    PowerShell parsed the original input as one command with zero syntax errors. An offline check with the PowerShell grammar pinned by the second release (0.26.4) produced two named nodes that its literal-command reader does not accept, command_name_expr and command_invokation_operator. This accounts for why the existing literal-command fix can miss this case. The live refusal exposed no internal rule identifier. The parser, URL-launch classifier and core execution-policy source files have identical Git blob IDs in 0.167.0-alpha.4.1 and the published 0.167.2.

    Could a maintainer confirm a supported correction or a native review path for this case? The expected regression test would allow a fixed local application to receive the link as data and would retain the existing protection for a command that actually opens a link.

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

    CLIbugsandboxwindows-os

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions