Repository navigation
fix(cli): reject non-decimal objdump and Rizin command timeouts - #9059
Plastic-time wants to merge 3 commits into
Conversation
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.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
[Medium impact] This change appears safe to merge; no new actionable issue was found. SummaryThe three objdump and Rizin commands now check decimal text before converting
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
Summary
inspect-with-objdump,list-objdump-architecturesandexecute-rizin-commandread--command-timeout-msthrough Incur'sNumber()coercion. So0x10ran the command with a 16 ms deadline, and1e3ran 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 --jsonexits 1 withprovider_timeout: "reached its 16 ms server/provider deadline (command_timeout_ms)".--command-timeout-ms 1e3exits 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 localcliCommandTimeoutpipescliIntegerArgument(1)intoreverseCommandTimeoutSchema.unwrap()and keeps the shared description. It followscliNativeDeadlinefrom fix(cli): reject non-decimal native UI and command deadline options #8920. All three commands use it.--command-timeout-msoptions, 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, andcliCommandTimeoutfor the timeout.Scope decision: not applicable. This is an ordinary fix within the existing CLI boundary.
Contract and boundary impact
reverseCommandTimeoutSchemainsrc/domain/reverseEngineering.tsowns the bounds. CLI argument parsing now admits only decimal text before that field.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.
Evidence and regression coverage
Tests added or updated: a new
objdump and Rizin command timeoutsblock intests/boundary/cli/cliIntegerArguments.test.ts.list-objdump-architecturestakes every malformed spelling from the shared list.inspect-with-objdumptakes0x10.execute-rizin-commandtakes1e3. 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.tsand a freshbuild:cached, the block gives 8 failed, 6 passed. The failures are the spellings thatNumber()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 16still 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:
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.bacc1e384: the block gives 14 passed. With main'sreverseEngineeringCommands.tsrebuilt, it gives 8 failed, 6 passed.npm run check:fastpassed again.passes Rizin decoder and map flags before the artifactfails on this Windows machine with and without this change. Its fake provider is a#!nodescript, which Windows cannot launch.npx oxfmt --checkon the two changed files: passed.Compatibility, safety, and release
0x10or1e3is now refused. The documented value is a decimal millisecond count, so this follows fix(cli): reject non-decimal byte-entropy window options #8919 and fix(cli): reject non-decimal native UI and command deadline options #8920 without a breaking marker.Author readiness
Human owner: @Plastic-time
Before merge
type(scope): outcome.