Skip to content

Security: Unsafe Stack Variable Deletion Without Proper Validation#456

Open
tuanaiseo wants to merge 1 commit into
mrexodia:mainfrom
tuanaiseo:contribai/fix/security/unsafe-stack-variable-deletion-without-p
Open

Security: Unsafe Stack Variable Deletion Without Proper Validation#456
tuanaiseo wants to merge 1 commit into
mrexodia:mainfrom
tuanaiseo:contribai/fix/security/unsafe-stack-variable-deletion-without-p

Conversation

@tuanaiseo

Copy link
Copy Markdown

Problem

The delete_stack function in api_stack.py deletes stack frame members based on user-provided name and address. While it checks for special frame members, the validation relies on IDA's internal APIs which may have edge cases. More critically, the declare_stack function allows creating arbitrary stack variables with user-controlled names, offsets, and types, which could corrupt function frames or be exploited for memory corruption in IDA's type system.

Severity: high
File: src/ida_pro_mcp/ida_mcp/api_stack.py

Solution

Add stricter validation for stack variable offsets and sizes. Ensure type names are validated against a whitelist. Consider requiring additional confirmation for destructive operations like delete_stack that modify binary analysis state.

Changes

  • src/ida_pro_mcp/ida_mcp/api_stack.py (modified)

Testing

  • Existing tests pass
  • Manual review completed
  • No new warnings/errors introduced

…oper vali

The delete_stack function in api_stack.py deletes stack frame members based on user-provided name and address. While it checks for special frame members, the validation relies on IDA's internal APIs which may have edge cases. More critically, the declare_stack function allows creating arbitrary stack variables with user-controlled names, offsets, and types, which could corrupt function frames or be exploited for memory corruption in IDA's type system.

Affected files: api_stack.py

Signed-off-by: tuanaiseo <221258316+tuanaiseo@users.noreply.github.com>
@mrexodia

Copy link
Copy Markdown
Owner

What is an actual input that triggers a crash or exploit in IDA that these checks guard against?

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants