Skip to content

fix(frida): name the argument each Frida input error rejects - #2217

Merged
morluto merged 1 commit into
mainfrom
fix/issue-2213
Oct 12, 2026
Merged

morluto merged 1 commit into
mainfrom
fix/issue-2213

Conversation

@kaoru0822-kitauji

Copy link
Copy Markdown
Collaborator

Summary

Most Frida input rejections returned invalid_request with an empty issues list, while the remediation said "Correct the listed arguments and retry." Each rejection now carries an AnalysisInputIssue naming the argument and the reason:

Where Argument Message
close_frida_session, resume_frida_session, load_frida_script, unload_frida_script, frida_session_status session_id No open Frida session <id>; start one with start_frida_session.
unload_frida_script (open session) script_id No loaded Frida script <id> in this session.
load_frida_script file source that cannot be read (other than EACCES/EPERM, which already return access_denied) path Cannot read Frida script file <path>.
instrument-with-frida attach <non-integer> target attach mode needs a positive integer process ID.
instrument-with-frida with neither or both of --script/--script-file script Provide exactly one of --script or --script-file.

The session and script messages live in a small src/application/frida/fridaInputErrors.ts, shared by the manager and the MCP status tool. No acceptance, routing or effect changes: the same inputs are rejected at the same points.

Fixes #2213

Before / after

MCP frida_session_status {session_id: <not open>}
before: {"error":{"code":"invalid_request","message":"Analysis input is invalid. …","remediation":{"action":"Correct the listed arguments and retry."}}}
after:  … "details":{"issues":[{"path":["session_id"],"reason":"invalid_value","message":"No open Frida session …; start one with start_frida_session."}]}

$ rea instrument-with-frida attach abc --script 'send(1)' --format json
after:  … "issues":[{"path":["target"],"reason":"invalid_value","message":"attach mode needs a positive integer process ID."}]

Validation

  • New tests: a manager test (names the unknown session or script ID it rejects) covers close, resume, load and unload with an unknown session, and unload with an unknown script. A CLI test (names the rejected instrument-with-frida argument) covers the non-integer PID and the missing script source, and asserts the provider is never started. All three fail on main and pass with this change; 30/30 tests in those files pass, and the other Frida suites (MCP, service, contracts) pass.
  • npm run lint passes.
  • npm test: 9247 passed, 14 failed in 7 files. These are the same environmental files that fail on clean origin/main on this host: Hopper not installed, Command Line Tools only (ibtool), hdiutil, and inspector target-location cases.

Related: #2211 (#2209) moves the one-shot workflow's script-file check before session start. This PR covers the explicit load_frida_script path and the session/script lookups; the two touch different files.

🤖 Generated with Claude Code

Frida session lookups, script lookups, unreadable script files and the
instrument-with-frida PID and script checks returned invalid_request with
no issues, while the remediation told callers to correct the listed
arguments. Attach the session_id, script_id, path, target or script issue
with the reason so CLI and MCP callers can see what to fix.

Fixes #2213

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 12, 2026 •

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 ✅ Completed 2026-10-12T14:52:21.677913Z 20b1ddb 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.

@morluto
morluto merged commit 86de439 into main Oct 12, 2026
30 checks passed
@morluto
morluto deleted the fix/issue-2213 branch October 12, 2026 15:01
@github-actions github-actions Bot mentioned this pull request Oct 12, 2026
3 tasks done
@morluto morluto added bug Something isn't working area: native Native analysis and decompilation, including Ghidra, IDA, and Hopper analysis behavior labels Oct 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: native Native analysis and decompilation, including Ghidra, IDA, and Hopper analysis behavior bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Frida input errors say "correct the listed arguments" but list none

2 participants