Skip to content

fix(cli): reject non-decimal objdump and Rizin command timeouts - #9059

Closed
Plastic-time wants to merge 3 commits into
morluto:mainfrom
Plastic-time:rrfz/decimal-reverse-command-timeouts
Closed

Plastic-time wants to merge 3 commits into
morluto:mainfrom
Plastic-time:rrfz/decimal-reverse-command-timeouts

Conversation

@Plastic-time

@Plastic-time Plastic-time commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Summary

inspect-with-objdump, list-objdump-architectures and execute-rizin-command read --command-timeout-ms through Incur's Number() coercion. So 0x10 ran the command with a 16 ms deadline, and 1e3 ran it with 1000 ms. #8919 and #8920 fixed the same coercion for other options. This change gives the three reverse-engineering commands the same decimal-only admission.

No issue is linked. I found this while checking which numeric CLI options still go through Number().

Problem and expected behavior

On main de8b2f359, with objdump on PATH:

  • rea list-objdump-architectures --command-timeout-ms 0x10 --json exits 1 with provider_timeout: "reached its 16 ms server/provider deadline (command_timeout_ms)".
  • --command-timeout-ms 1e3 exits 0 and runs with a 1000 ms deadline.

Expected: the option takes decimal text only. A non-decimal spelling is refused during argument parsing and names the field. Decimal values keep the shared bounds (1 to the existing maximum) and the omitted default.

Change and scope

  • src/cli/reverseEngineeringCommands.ts: a local cliCommandTimeout pipes cliIntegerArgument(1) into reverseCommandTimeoutSchema.unwrap() and keeps the shared description. It follows cliNativeDeadline from fix(cli): reject non-decimal native UI and command deadline options #8920. All three commands use it.
  • MCP is unchanged. It receives JSON numbers.
  • Not included: the browser and web --command-timeout-ms options, which are separate commands in other files.

#8991 has since landed. It added Rizin decoder options right above commandTimeoutMs. I merged main and kept both: the decoder options as #8991 wrote them, and cliCommandTimeout for the timeout.

Scope decision: not applicable. This is an ordinary fix within the existing CLI boundary.

Contract and boundary impact

  • Semantic owner and earliest changed stage: reverseCommandTimeoutSchema in src/domain/reverseEngineering.ts owns the bounds. CLI argument parsing now admits only decimal text before that field.
  • Contribution scope fit and linked maintainer decision: ordinary fix; not applicable.
  • CLI and MCP/tool-catalog contract: the CLI option now refuses non-decimal text. MCP is unchanged.
  • Provider, bridge, target-format, or platform compatibility: none. A decimal timeout reaches objdump or Rizin as before.
  • Evidence, artifact, provenance, or reconstruction contract: none.
  • Target selection, authority, upstream behavior, and cleanup details (if applicable): a refused option starts no provider process.
  • Generated metadata (docs/public/product-catalog.json), package, or installation impact: none committed.

Expected effects (check known effects; use documentation-only on its own).
Unchecked items do not establish absence; leave uncertainties visible.

  • Read existing files or captured data.
  • Launch or attach to a process.
  • Inject instrumentation or run scripts/code.
  • Change process memory, registers, files, or configuration.
  • Contact network services.
  • Recover protected code or work around protections.
  • Documentation or usability only; no target interaction.
  • Not sure yet; investigation or maintainer guidance needed.

Evidence and regression coverage

  • Tests added or updated: a new objdump and Rizin command timeouts block in tests/boundary/cli/cliIntegerArguments.test.ts. list-objdump-architectures takes every malformed spelling from the shared list. inspect-with-objdump takes 0x10. execute-rizin-command takes 1e3. One more case keeps --command-timeout-ms=00120000: that request is admitted and then refused for its missing target. The padded value keeps the default deadline, so the missing-file check cannot time out first.

  • Base reproduction: with main's reverseEngineeringCommands.ts and a fresh build:cached, the block gives 8 failed, 6 passed. The failures are the spellings that Number() admits within bounds (1\n, 0x1, 0b1, 1e0, +1, 1.0, 0x10, 1e3). With this change: 14 passed.

  • User-visible CLI output, list-objdump-architectures --command-timeout-ms 0x10 --json:

    Before:

    {"code":"provider_timeout","category":"timeout","message":"This objdump or rizin command reached its 16 ms server/provider deadline (command_timeout_ms) during target preflight or the one-shot command (deadlineExpired). ..."}

    After:

    {"code":"VALIDATION_ERROR","message":"REA could not read the command arguments. Check the named argument and its expected type, then try again.","fieldErrors":[{"code":"invalid_format","missing":false,"path":"commandTimeoutMs","expected":"","received":"","message":"Expected a decimal integer"}]}

    --command-timeout-ms 16 still reaches objdump and reports the 16 ms deadline.

  • Remaining proof gaps: Rizin is not installed on this machine. Its cases stop at argument parsing or at the missing target, before any provider launch. Linux CI has not run yet.

Boundary regressions: input admission at the CLI argument boundary, through the compiled CLI. Lifecycle regressions: not applicable, since a refused option launches nothing.

For evidence-bearing changes:

  • Observed, derived, and inferred claims remain distinguishable.
  • Artifact identity, source provenance, and failed attempts remain preserved.
  • Unsupported, incomplete, unavailable, or uncertain outcomes remain visible.

Not an evidence-bearing change.

Validation performed

Windows 11, Node.js 24.22.1, base de8b2f359.

  • npx vitest run tests/boundary/cli/cliIntegerArguments.test.ts -t "objdump and Rizin": 14 passed. With main's source rebuilt: 8 failed, 6 passed.
  • npx vitest run tests/boundary/cli/cliIntegerArguments.test.ts tests/boundary/cli/cliToolCoverage.test.ts tests/boundary/cli/objdumpIdentity.test.ts tests/boundary/cli/reverseEngineeringTargetInput.test.ts: 110 passed.
  • npm run check:fast: passed, no lint errors.
  • After merging main bacc1e384: the block gives 14 passed. With main's reverseEngineeringCommands.ts rebuilt, it gives 8 failed, 6 passed. npm run check:fast passed again.
  • feat(rizin): select the decoder and map address for one-shot commands #8991's passes Rizin decoder and map flags before the artifact fails on this Windows machine with and without this change. Its fake provider is a #!node script, which Windows cannot launch.
  • npx oxfmt --check on the two changed files: passed.

Compatibility, safety, and release

Author readiness

Human owner: @Plastic-time

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

Before merge

  • This PR addresses a concrete problem or an agreed enhancement.
  • Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff.
  • The PR has one focused outcome and the title follows type(scope): outcome.
  • Related issue is linked, or the reason for not linking one is stated above.
  • Tests cover changed observable behavior and meaningful failure paths.
  • Owning docs, contracts, and generated metadata are updated where needed.
  • User-visible CLI/MCP changes include representative output.
  • I checked the final diff for secrets, unrelated cleanup, and unsupported claims.

inspect-with-objdump, list-objdump-architectures and execute-rizin-command took --command-timeout-ms through Number(), so 0x10 ran with a 16 ms deadline and 1e3 with 1000 ms. Admit decimal text only and keep the shared field's bounds.
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-11-06T03:00:38.968792Z
We couldn’t complete this review. Comment @codex review to try again.
fc71444 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

@greptile-apps

greptile-apps Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5 Tier: plus

[Medium impact] This change appears safe to merge; no new actionable issue was found.

Summary

The three objdump and Rizin commands now check decimal text before converting --command-timeout-ms to a number.

  • Reverse-engineering commands accept decimal timeout values only.

Reviews (3) · Last reviewed commit: "Merge remote-tracking branch 'origin/mai..." · Reviewed by Greptile

The case used --command-timeout-ms=016, so the missing-file check had
only 16 ms. A busy runner could time out before the invalid_request
refusal. 00120000 still proves a padded decimal is admitted and gives
the check the default deadline.
…command-timeouts

# Conflicts:
#	src/cli/reverseEngineeringCommands.ts
@morluto morluto closed this Nov 7, 2026
@morluto morluto added area: cli CLI adapter and one-shot commands bug Something isn't working provider: objdump Analysis provider / engine: objdump provider: rizin Analysis provider / engine: rizin labels Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: cli CLI adapter and one-shot commands bug Something isn't working provider: objdump Analysis provider / engine: objdump provider: rizin Analysis provider / engine: rizin

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants