Skip to content

Demangler crashes if using crafted name. #8230

@rbran

Description

@rbran

Binary Ninja crashes if one of the compiled files bellow are open.

small name ("only" 2000 chars)
mini.c
full name (the max the demangler allow)
full.c

The demangler plugins from the binaryninja-api don't have any recursion limiter, so a GNU3/MSVC name could cause the stack to grow very large and overflow.

The plugins can handle names with up to 262144, In my test a simple 2000 len name will cause the crash, but it will depend on the environment stack limit.

To compile just use:

gcc -shared mini.c -o mini.so

This is not a security vulnerability, it probably will never happen in a legit binary. The only citation I think this could happen is as obfuscation technique to difficult binary analyze.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions